@zinn-dev/cli 0.42.0 → 0.43.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 (41) hide show
  1. package/package.json +3 -4
  2. package/skills/zinn/SKILL.md +1 -1
  3. package/src/capabilities-schema.d.ts +3 -3
  4. package/src/errors.d.ts +31 -3
  5. package/src/errors.js +75 -20
  6. package/src/lib.d.ts +14 -5
  7. package/src/lib.js +68 -33
  8. package/src/list-continuation.d.ts +11 -0
  9. package/src/list-continuation.js +18 -0
  10. package/src/list-limit.d.ts +11 -0
  11. package/src/list-limit.js +17 -0
  12. package/src/presentation/activity-presentation.js +18 -5
  13. package/src/presentation/description-presentation.d.ts +3 -16
  14. package/src/presentation/description-presentation.js +22 -21
  15. package/src/presentation/project-presentation.d.ts +6 -2
  16. package/src/presentation/project-presentation.js +9 -1
  17. package/src/presentation/relation-presentation.d.ts +6 -1
  18. package/src/presentation/relation-presentation.js +14 -0
  19. package/src/presentation/row-layout.d.ts +1 -1
  20. package/src/presentation/row-layout.js +6 -5
  21. package/src/presentation/task-presentation.js +7 -1
  22. package/src/presentation/text-width.d.ts +2 -0
  23. package/src/presentation/text-width.js +43 -0
  24. package/src/presentation/time.d.ts +3 -1
  25. package/src/presentation/time.js +5 -2
  26. package/src/result-schemas.d.ts +49 -3
  27. package/src/result-schemas.js +12 -3
  28. package/src/routes/activity-router.d.ts +45 -1
  29. package/src/routes/activity-router.js +113 -15
  30. package/src/routes/project-router.d.ts +40 -0
  31. package/src/routes/project-router.js +73 -12
  32. package/src/routes/relation-router.d.ts +7 -3
  33. package/src/routes/relation-router.js +73 -56
  34. package/src/routes/restore-router.js +2 -5
  35. package/src/routes/router.js +54 -27
  36. package/src/routes/routes.d.ts +169 -7
  37. package/src/routes/task-router.d.ts +84 -6
  38. package/src/routes/task-router.js +107 -19
  39. package/src/timestamp-input.d.ts +3 -0
  40. package/src/timestamp-input.js +31 -0
  41. package/src/types.d.ts +3 -3
@@ -2,9 +2,9 @@ import { parseArgs } from "node:util";
2
2
  import { relation, relationTypeSchema, task } from "@zinn-dev/core";
3
3
  import { jsonResult } from "../results.js";
4
4
  import { generateCommandUsage, taskKeyPositional } from "../input.js";
5
- import { output, quit, requireStringOption, validatePositionals, validateUniqueOptions, } from "../lib.js";
5
+ import { output, diagnostic, confirmAction, confirmationDescription, quit, requireStringOption, validatePositionals, validateUniqueOptions, } from "../lib.js";
6
6
  import { currentActor } from "../actor.js";
7
- import { formatRelationChange, formatRelationList, presentRelations, } from "../presentation/relation-presentation.js";
7
+ import { formatRelationChange, formatRelationList, presentRelations, presentRelationChange, } from "../presentation/relation-presentation.js";
8
8
  const guessedRelationTypes = new Map([
9
9
  ["depends-on", "dependency"],
10
10
  ["parent", "subtask"],
@@ -13,7 +13,7 @@ const guessedRelationTypes = new Map([
13
13
  ]);
14
14
  function relationFlagSuggestions(action) {
15
15
  const options = {
16
- ...relationInputs.create.options,
16
+ ...relationInputs[action].options,
17
17
  ...Object.fromEntries([...guessedRelationTypes.keys()].map((name) => [name, { type: "string" }])),
18
18
  };
19
19
  const suggest = (args) => {
@@ -44,17 +44,18 @@ function relationFlagSuggestions(action) {
44
44
  };
45
45
  return Object.fromEntries([...guessedRelationTypes.keys()].map((name) => [`--${name}`, suggest]));
46
46
  }
47
- function parseRelationArgs(args) {
47
+ function parseRelationArgs(args, action) {
48
+ const input = relationInputs[action];
48
49
  const { values, positionals, tokens } = parseArgs({
49
50
  args,
50
- options: relationInputs.create.options,
51
+ options: input.options,
51
52
  allowPositionals: true,
52
53
  strict: true,
53
54
  tokens: true,
54
55
  });
55
- validateUniqueOptions(tokens, relationInputs.create.options);
56
- validatePositionals(positionals, relationInputs.create.forms[0]);
57
- const type = requireStringOption(relationInputs.create.options.type, values.type, "type", `--type must be one of these: ${relationInputs.create.options.type.value.choices.join(", ")}`);
56
+ validateUniqueOptions(tokens, input.options);
57
+ validatePositionals(positionals, input.forms[0]);
58
+ const type = requireStringOption(relationPairInput.options.type, values.type, "type", `--type must be one of these: ${relationPairInput.options.type.value.choices.join(", ")}`);
58
59
  const typeResult = relationTypeSchema.safeParse(type);
59
60
  if (!typeResult.success) {
60
61
  quit(`--type must be one of these: ${relationTypeSchema.options.join(", ")}`, undefined, {
@@ -63,31 +64,39 @@ function parseRelationArgs(args) {
63
64
  }
64
65
  const sourceTaskKey = positionals[0];
65
66
  const targetTaskKey = positionals[1];
66
- return { sourceTaskKey, targetTaskKey, relation_type: typeResult.data };
67
+ return {
68
+ props: { sourceTaskKey, targetTaskKey, relation_type: typeResult.data },
69
+ isPreconfirmed: "yes" in values && values.yes === true,
70
+ };
67
71
  }
68
- const relationInputs = {
69
- create: {
70
- options: {
71
- type: {
72
- type: "string",
73
- required: true,
74
- value: {
75
- kind: "enum",
76
- choices: relationTypeSchema.options,
77
- },
72
+ const relationPairInput = {
73
+ options: {
74
+ type: {
75
+ type: "string",
76
+ required: true,
77
+ value: {
78
+ kind: "enum",
79
+ choices: relationTypeSchema.options,
78
80
  },
79
81
  },
80
- forms: [
81
- {
82
- id: "default",
83
- positionals: [
84
- { ...taskKeyPositional, name: "source-task-key" },
85
- { ...taskKeyPositional, name: "target-task-key" },
86
- ],
87
- },
88
- ],
89
- constraints: [],
90
82
  },
83
+ forms: [
84
+ {
85
+ id: "default",
86
+ positionals: [
87
+ { ...taskKeyPositional, name: "source-task-key" },
88
+ { ...taskKeyPositional, name: "target-task-key" },
89
+ ],
90
+ },
91
+ ],
92
+ constraints: [],
93
+ };
94
+ const relationInputs = {
95
+ create: {
96
+ ...relationPairInput,
97
+ options: { ...relationPairInput.options, yes: { type: "boolean" } },
98
+ },
99
+ delete: relationPairInput,
91
100
  list: {
92
101
  options: {},
93
102
  forms: [
@@ -101,31 +110,45 @@ const relationInputs = {
101
110
  };
102
111
  export const relationRouter = {
103
112
  create: {
104
- summary: "Create a relation between two tasks.",
105
- effects: { domain: "create", storage: "normal-open" },
106
- confirmation: { kind: "none" },
113
+ summary: "Create a relation, confirming replacement of conflicting links.",
114
+ effects: { domain: "replace", storage: "normal-open" },
115
+ confirmation: {
116
+ kind: "prompt",
117
+ description: `Only asks when replacing existing relations. ${confirmationDescription}`,
118
+ },
107
119
  input: relationInputs.create,
108
120
  results: [jsonResult("RelationChange")],
109
121
  guessedFlags: relationFlagSuggestions("create"),
110
- run: (args) => {
111
- const props = parseRelationArgs(args);
122
+ run: async (args) => {
123
+ const { props, isPreconfirmed } = parseRelationArgs(args, "create");
112
124
  const { sourceTaskKey, targetTaskKey } = props;
113
- const createdRelation = relation.create(props, currentActor());
114
125
  const source = task.getByKey(sourceTaskKey);
115
126
  const target = task.getByKey(targetTaskKey);
116
- const created = {
117
- id: createdRelation.id,
118
- type: props.relation_type,
119
- source: source.key,
120
- source_task_id: source.id,
121
- target: target.key,
122
- target_task_id: target.id,
123
- };
127
+ let replace = isPreconfirmed;
128
+ if (!isPreconfirmed) {
129
+ const conflicts = relation.getConflicts(props);
130
+ if (conflicts.length > 0) {
131
+ const canReplace = await confirmAction(formatRelationChange({ type: props.relation_type, source: source.key, target: target.key }, {
132
+ action: "replace",
133
+ replaced: conflicts.map((entry) => presentRelationChange(entry, entry.source, entry.target)),
134
+ }), false);
135
+ if (!canReplace) {
136
+ diagnostic("Relation creation cancelled");
137
+ return;
138
+ }
139
+ replace = conflicts.map((entry) => entry.id);
140
+ }
141
+ }
142
+ const createdRelation = relation.create({ ...props, replace }, currentActor());
143
+ const created = presentRelationChange(createdRelation, source, target);
124
144
  output(created, (entry) => formatRelationChange(entry, { action: "create" }));
125
145
  },
126
146
  help: `${generateCommandUsage("task relation create", relationInputs.create)}
127
147
 
128
148
  Create a relation between two tasks.
149
+ Each pair may have one relation. Changing its type or direction asks to replace the existing links.
150
+ Use --yes to authorize replacement without a prompt, including with --json or without a terminal.
151
+ An exact existing relation is an error, including with --yes.
129
152
 
130
153
  Types:
131
154
  related Connect two tasks, with any order provided to indicate relation.
@@ -133,8 +156,9 @@ Types:
133
156
  duplicate Source is a duplicate of target.
134
157
  subtask Source is a subtask of target (child -> parent).
135
158
 
136
- A task may have one parent and many subtasks. Nesting is allowed; cycles are rejected.
137
- Remove an existing subtask relation before assigning a different parent.
159
+ A task may have one parent and many subtasks. Nesting is allowed. Cycles are rejected.
160
+ Assigning a different parent asks to replace the previous parent link and any conflicting link to the new parent.
161
+ One confirmation covers every removed link. If those links change while confirmation is open, the command fails.
138
162
 
139
163
  Relations do not automatically move, complete, or archive tasks.
140
164
  Deleting a parent removes its links and preserves its subtasks.
@@ -170,25 +194,18 @@ Example: zinn task relation list APP-1`,
170
194
  summary: "Remove only the specified relation. No confirmation is required.",
171
195
  effects: { domain: "delete", storage: "normal-open" },
172
196
  confirmation: { kind: "none" },
173
- input: relationInputs.create,
197
+ input: relationInputs.delete,
174
198
  results: [jsonResult("RelationChange")],
175
199
  guessedFlags: relationFlagSuggestions("delete"),
176
200
  run: (args) => {
177
- const props = parseRelationArgs(args);
201
+ const { props } = parseRelationArgs(args, "delete");
178
202
  const deletedRelation = relation.delete(props, currentActor());
179
203
  const source = task.getByKey(props.sourceTaskKey);
180
204
  const target = task.getByKey(props.targetTaskKey);
181
- const deleted = {
182
- id: deletedRelation.id,
183
- type: props.relation_type,
184
- source: source.key,
185
- source_task_id: source.id,
186
- target: target.key,
187
- target_task_id: target.id,
188
- };
205
+ const deleted = presentRelationChange(deletedRelation, source, target);
189
206
  output(deleted, (entry) => formatRelationChange(entry, { action: "delete" }));
190
207
  },
191
- help: `${generateCommandUsage("task relation delete", relationInputs.create)}
208
+ help: `${generateCommandUsage("task relation delete", relationInputs.delete)}
192
209
 
193
210
  Remove only the specified relation. No confirmation is required.
194
211
 
@@ -1,6 +1,6 @@
1
1
  import { parseArgs } from "node:util";
2
2
  import { resolve } from "node:path";
3
- import { backup, RestoreRefusedError, getStorage } from "@zinn-dev/core";
3
+ import { backup, RestoreRefusedError, getStorage, isSqliteErrorFamily } from "@zinn-dev/core";
4
4
  import { jsonResult } from "../results.js";
5
5
  import { reportLockWait } from "../database.js";
6
6
  import { confirmationDescription } from "../lib.js";
@@ -57,10 +57,7 @@ export const restoreCommand = {
57
57
  catch (error) {
58
58
  // A refusal attempted nothing, so only a failed restore points at the backups.
59
59
  if (!(error instanceof RestoreRefusedError)) {
60
- const isDamagedDatabase = error instanceof Error &&
61
- "code" in error &&
62
- typeof error.code === "string" &&
63
- error.code.startsWith("SQLITE_CORRUPT");
60
+ const isDamagedDatabase = isSqliteErrorFamily(error, "SQLITE_CORRUPT");
64
61
  if (isDamagedDatabase) {
65
62
  diagnostic(`The database at ${databasePath} is damaged. Nothing was changed. To restore it:\n` +
66
63
  `1. Close every program that has the database open.\n` +
@@ -3,7 +3,8 @@ import { routerOptions, helpSpellings, versionSpellings, usageLabel } from "../i
3
3
  import { getCommandAliases } from "./aliases.js";
4
4
  import { classifyFailure, CliError } from "../errors.js";
5
5
  import { quotedColumnHint } from "../column-hint.js";
6
- import { dashValueHelp, diagnostic, failureMessage, flushDiagnostics, isAllowLegacyReadFlag, isHelpFlag, isRouterFlag, parseArgsMessage, prepareOutput, quit, renderFailure, setLegacyReadAllowed, UsageError, validateUniqueOptions, } from "../lib.js";
6
+ import { formatCell } from "../presentation/row-layout.js";
7
+ import { boundParserMessage, dashValueHelp, diagnostic, failureMessage, flushDiagnostics, isAllowLegacyReadFlag, isHelpFlag, isRouterFlag, parseArgsFailure, prepareOutput, quit, renderFailure, setLegacyReadAllowed, UsageError, validateUniqueOptions, } from "../lib.js";
7
8
  // ZINN_DEBUG=1 prints routing detail on stderr, so stdout and `--json` results stay unchanged.
8
9
  function isDebugOutputEnabled() {
9
10
  return process.env.ZINN_DEBUG === "1";
@@ -36,11 +37,18 @@ function getCommandHelp(help, aliases) {
36
37
  function toCommand(args) {
37
38
  return args.join(" ");
38
39
  }
39
- // Groups sibling commands into one line, e.g. " comment {create|list|edit|delete}".
40
- // A command without siblings is not a choice, so it gets no braces, e.g. " backup".
41
- // Top-level commands in the root help are unrelated to each other, so each gets its own line.
40
+ // Namespace help describes each command. Root help groups sibling names into choices.
42
41
  function formatCommands(parsedRoutes, prefix) {
43
42
  const isRootHelp = prefix === "";
43
+ if (!isRootHelp) {
44
+ const commands = parsedRoutes
45
+ .filter(({ command }) => command.startsWith(prefix))
46
+ .map(({ command, summary }) => ({ name: command.slice(prefix.length), summary }));
47
+ const nameWidth = Math.max(0, ...commands.map(({ name }) => name.length));
48
+ return commands
49
+ .map(({ name, summary }) => ` ${formatCell({ text: name }, nameWidth)} ${summary}`)
50
+ .join("\n");
51
+ }
44
52
  const siblingsByParent = new Map();
45
53
  for (const { command } of parsedRoutes) {
46
54
  if (!command.startsWith(prefix)) {
@@ -109,15 +117,28 @@ function routeToNamespace(parsedRoutes, words, isHelpRequest) {
109
117
  return;
110
118
  }
111
119
  if (unknownWord == null) {
112
- quit(`Missing a command for "${commandName}"`, help, { argument: "command" });
120
+ quit(`Missing a command for "${commandName}"`, help, {
121
+ argument: "command",
122
+ reason: "missing_command",
123
+ });
113
124
  }
114
125
  const reason = `Unrecognized command "${unknownWord}" for "${commandName}"`;
115
126
  if (isHelpRequest) {
116
- quit(reason, help, { argument: "command" });
127
+ quit(boundParserMessage(reason), help, { argument: "command", reason: "unknown_command" });
117
128
  }
118
- quit(`${reason}. Run \`${commandName} --help\` for a list of available commands`, undefined, {
119
- argument: "command",
120
- });
129
+ const guidance = `Run \`${commandName} --help\` for a list of available commands`;
130
+ throw new CliError(boundParserMessage(`${reason}. ${guidance}`, { reason, guidance }), "invalid_input", { argument: "command", reason: "unknown_command" }, undefined, namespace === "" ? [] : namespace.split(" "));
131
+ }
132
+ /** Resolves the longest canonical or alias command prefix. */
133
+ function findCommand(parsedRoutes, args) {
134
+ for (let endIndex = args.length; endIndex >= 0; endIndex--) {
135
+ const command = toCommand(args.slice(0, endIndex));
136
+ const match = parsedRoutes.find((route) => route.command === command || route.aliases.some((path) => toCommand(path) === command));
137
+ if (match !== undefined) {
138
+ return { match, nestingLevel: endIndex };
139
+ }
140
+ }
141
+ return undefined;
121
142
  }
122
143
  export function parseRoutes(routesDef, prefix) {
123
144
  const routeDefinitions = [];
@@ -160,17 +181,10 @@ async function route(parsedRoutes, rawArgs, beforeRun) {
160
181
  const args = isHelpRequest
161
182
  ? filteredRoutableArgs.slice(0, helpFlagIndex)
162
183
  : [...filteredRoutableArgs, ...passthroughArgs];
163
- let match = null;
164
- let nestingLevel = 0;
165
- for (let endIndex = args.length; endIndex >= 0; endIndex--) {
166
- const command = toCommand(args.slice(0, endIndex));
167
- const matchedRoute = parsedRoutes.find((r) => r.command === command || r.aliases.some((path) => toCommand(path) === command));
168
- if (matchedRoute) {
169
- match = matchedRoute;
170
- nestingLevel = endIndex;
171
- break;
172
- }
173
- }
184
+ const { match, nestingLevel } = findCommand(parsedRoutes, args) ?? {
185
+ match: null,
186
+ nestingLevel: 0,
187
+ };
174
188
  if (isDebugOutputEnabled()) {
175
189
  diagnostic(`::router.route ${match?.command ?? "namespace"}`);
176
190
  }
@@ -195,7 +209,11 @@ async function route(parsedRoutes, rawArgs, beforeRun) {
195
209
  const columnHint = quotedColumnHint(err, match, rawArgs, nestingLevel);
196
210
  if (columnHint !== undefined) {
197
211
  const failure = classifyFailure(err);
198
- throw new CliError(`${failureMessage(err, "Command failed")}. Did you mean: ${columnHint}`, failure.code, failure.details, failure.help ?? getUsage(match.help));
212
+ const reason = failureMessage(err, "Command failed");
213
+ throw new CliError(boundParserMessage(`${reason}. Did you mean: ${columnHint}`, {
214
+ reason,
215
+ guidance: "Quote each column name containing spaces. Full command omitted because it is long.",
216
+ }), failure.code, { ...failure.details, reason: "unquoted_column" }, failure.help ?? getUsage(match.help), match.command.split(" "));
199
217
  }
200
218
  if (err instanceof UsageError) {
201
219
  throw err;
@@ -204,14 +222,23 @@ async function route(parsedRoutes, rawArgs, beforeRun) {
204
222
  const failure = classifyFailure(err);
205
223
  const isMissingProject = failure.code === "not_found" && failure.details?.entity === "project";
206
224
  if (isMissingProject) {
207
- throw new CliError(failureMessage(err, "Search failed"), failure.code, failure.details, getUsage(match.help));
225
+ throw new CliError(failureMessage(err, "Search failed"), failure.code, failure.details, getUsage(match.help), failure.suggestedRoute);
208
226
  }
209
227
  }
210
- const suggestFor = (flag) => match.guessedFlags?.[flag]?.(commandArgs);
211
- const parseArgsReason = parseArgsMessage(err, rawArgs, suggestFor);
212
- if (parseArgsReason != null) {
213
- const argument = /(?:Unknown option|Option) '(-[^' ]+)/.exec(err.message)?.[1];
214
- quit(parseArgsReason, getUsage(match.help), argument === undefined ? undefined : { argument });
228
+ const suggestFor = (flag) => {
229
+ const suggestion = match.guessedFlags?.[flag]?.(commandArgs);
230
+ if (suggestion === undefined) {
231
+ return undefined;
232
+ }
233
+ const target = findCommand(parsedRoutes, suggestion);
234
+ return target === undefined
235
+ ? undefined
236
+ : { args: suggestion, route: target.match.command.split(" ") };
237
+ };
238
+ const parserFailure = parseArgsFailure(err, rawArgs, suggestFor, match.command.split(" "));
239
+ if (parserFailure !== null) {
240
+ parserFailure.help = getUsage(match.help);
241
+ throw parserFailure;
215
242
  }
216
243
  throw err;
217
244
  }
@@ -408,6 +408,46 @@ export declare const routes: {
408
408
  run: (args: Array<string>) => void;
409
409
  help: string;
410
410
  };
411
+ delete: {
412
+ summary: string;
413
+ effects: {
414
+ domain: "delete";
415
+ storage: "normal-open";
416
+ };
417
+ confirmation: {
418
+ kind: "prompt";
419
+ description: string;
420
+ };
421
+ input: {
422
+ readonly options: {
423
+ readonly yes: {
424
+ readonly type: "boolean";
425
+ };
426
+ };
427
+ readonly forms: readonly [{
428
+ readonly id: "default";
429
+ readonly positionals: readonly [{
430
+ readonly name: "project-key";
431
+ readonly min: 1;
432
+ readonly max: 1;
433
+ readonly value: {
434
+ readonly kind: "project-key";
435
+ };
436
+ }, {
437
+ readonly name: "column-name";
438
+ readonly min: 1;
439
+ readonly max: 1;
440
+ readonly value: {
441
+ readonly kind: "column-name";
442
+ };
443
+ }];
444
+ }];
445
+ readonly constraints: readonly [];
446
+ };
447
+ results: import("../results.js").CommandResult[];
448
+ run: (args: string[]) => Promise<void>;
449
+ help: string;
450
+ };
411
451
  };
412
452
  };
413
453
  task: {
@@ -455,6 +495,14 @@ export declare const routes: {
455
495
  readonly description: "Omission leaves priority unassigned on creation and unchanged on edit. none clears priority; JSON uses null.";
456
496
  };
457
497
  };
498
+ readonly due: {
499
+ readonly type: "string";
500
+ readonly value: {
501
+ readonly kind: "timestamp";
502
+ readonly name: "timestamp";
503
+ readonly description: "Integer epoch milliseconds or YYYY-MM-DDTHH:mm:ss[.SSS] with Z or a numeric offset. Fractions have 1 to 3 digits. none clears the deadline, ignoring case. Omission leaves it unset on creation and unchanged on edit.";
504
+ };
505
+ };
458
506
  readonly label: {
459
507
  readonly type: "string";
460
508
  readonly multiple: true;
@@ -537,6 +585,23 @@ export declare const routes: {
537
585
  };
538
586
  input: {
539
587
  readonly options: {
588
+ readonly limit: {
589
+ readonly type: "string";
590
+ readonly value: {
591
+ readonly kind: "positive-integer";
592
+ readonly name: "n";
593
+ readonly pattern: string;
594
+ };
595
+ readonly description: "Return at most n results after all filters. Use an integer from 1 through 11871.";
596
+ };
597
+ readonly sort: {
598
+ readonly type: "string";
599
+ readonly value: {
600
+ readonly kind: "enum";
601
+ readonly name: "key";
602
+ readonly choices: ("activity" | "due")[];
603
+ };
604
+ };
540
605
  readonly archived: {
541
606
  readonly type: "boolean";
542
607
  };
@@ -561,6 +626,30 @@ export declare const routes: {
561
626
  readonly name: "name";
562
627
  };
563
628
  };
629
+ readonly "starting-after": {
630
+ readonly type: "string";
631
+ readonly value: {
632
+ readonly kind: "task-id";
633
+ readonly name: "id";
634
+ readonly description: "Task UUID or globally unambiguous left prefix with at least 8 hexadecimal digits. Canonical or compact, case-insensitive";
635
+ };
636
+ };
637
+ readonly "due-since": {
638
+ readonly type: "string";
639
+ readonly value: {
640
+ readonly kind: "timestamp";
641
+ readonly name: "timestamp";
642
+ readonly description: "Inclusive lower deadline bound. Integer epoch milliseconds or a timestamp with seconds and Z or a numeric offset. Fractions have 1 to 3 digits. Undated tasks do not match.";
643
+ };
644
+ };
645
+ readonly "due-until": {
646
+ readonly type: "string";
647
+ readonly value: {
648
+ readonly kind: "timestamp";
649
+ readonly name: "timestamp";
650
+ readonly description: "Inclusive upper deadline bound in the same formats as --due-since. Must be at or after --due-since. Undated tasks do not match.";
651
+ };
652
+ };
564
653
  };
565
654
  readonly forms: readonly [{
566
655
  readonly id: "default";
@@ -580,7 +669,7 @@ export declare const routes: {
580
669
  readonly kind: "exclusive";
581
670
  readonly members: readonly ["positional:project-key", "option:all-projects"];
582
671
  }];
583
- readonly notes: readonly ["An omitted project key uses defaultProject, or all projects if unset. --all-projects overrides the default and cannot be combined with a project key."];
672
+ readonly notes: readonly ["An omitted project key uses defaultProject, or all projects if unset. --all-projects overrides the default and cannot be combined with a project key.", "A --starting-after task must match every selection filter. Cursor resolution uses current task identities before list filtering."];
584
673
  };
585
674
  results: import("../results.js").CommandResult[];
586
675
  run: (args: string[]) => void;
@@ -611,8 +700,9 @@ export declare const routes: {
611
700
  readonly value: {
612
701
  readonly kind: "positive-integer";
613
702
  readonly name: "n";
614
- readonly pattern: "^[1-9]\\d{0,14}$";
703
+ readonly pattern: string;
615
704
  };
705
+ readonly description: "Return at most n results after all filters. Use an integer from 1 through 11871.";
616
706
  };
617
707
  readonly label: {
618
708
  readonly type: "string";
@@ -622,6 +712,22 @@ export declare const routes: {
622
712
  readonly name: "name";
623
713
  };
624
714
  };
715
+ readonly "due-since": {
716
+ readonly type: "string";
717
+ readonly value: {
718
+ readonly kind: "timestamp";
719
+ readonly name: "timestamp";
720
+ readonly description: "Inclusive lower deadline bound. Integer epoch milliseconds or a timestamp with seconds and Z or a numeric offset. Fractions have 1 to 3 digits. Undated tasks do not match.";
721
+ };
722
+ };
723
+ readonly "due-until": {
724
+ readonly type: "string";
725
+ readonly value: {
726
+ readonly kind: "timestamp";
727
+ readonly name: "timestamp";
728
+ readonly description: "Inclusive upper deadline bound in the same formats as --due-since. Must be at or after --due-since. Undated tasks do not match.";
729
+ };
730
+ };
625
731
  };
626
732
  readonly forms: readonly [{
627
733
  readonly id: "default";
@@ -707,6 +813,14 @@ export declare const routes: {
707
813
  readonly description: "Omission leaves priority unassigned on creation and unchanged on edit. none clears priority; JSON uses null.";
708
814
  };
709
815
  };
816
+ readonly due: {
817
+ readonly type: "string";
818
+ readonly value: {
819
+ readonly kind: "timestamp";
820
+ readonly name: "timestamp";
821
+ readonly description: "Integer epoch milliseconds or YYYY-MM-DDTHH:mm:ss[.SSS] with Z or a numeric offset. Fractions have 1 to 3 digits. none clears the deadline, ignoring case. Omission leaves it unset on creation and unchanged on edit.";
822
+ };
823
+ };
710
824
  readonly "add-label": {
711
825
  readonly type: "string";
712
826
  readonly multiple: true;
@@ -790,7 +904,7 @@ export declare const routes: {
790
904
  readonly requires: "option:replacing";
791
905
  }, {
792
906
  readonly kind: "atLeastOne";
793
- readonly members: readonly ["option:title", "option:description", "option:description-file", "option:priority", "option:add-label", "option:remove-label"];
907
+ readonly members: readonly ["option:title", "option:description", "option:description-file", "option:priority", "option:due", "option:add-label", "option:remove-label"];
794
908
  }];
795
909
  readonly notes: readonly [string];
796
910
  };
@@ -1014,14 +1128,18 @@ export declare const routes: {
1014
1128
  create: {
1015
1129
  summary: string;
1016
1130
  effects: {
1017
- domain: "create";
1131
+ domain: "replace";
1018
1132
  storage: "normal-open";
1019
1133
  };
1020
1134
  confirmation: {
1021
- kind: "none";
1135
+ kind: "prompt";
1136
+ description: string;
1022
1137
  };
1023
1138
  input: {
1024
1139
  readonly options: {
1140
+ readonly yes: {
1141
+ readonly type: "boolean";
1142
+ };
1025
1143
  readonly type: {
1026
1144
  readonly type: "string";
1027
1145
  readonly required: true;
@@ -1055,7 +1173,7 @@ export declare const routes: {
1055
1173
  guessedFlags: {
1056
1174
  [k: string]: (args: Array<string>) => string[] | undefined;
1057
1175
  };
1058
- run: (args: string[]) => void;
1176
+ run: (args: string[]) => Promise<void>;
1059
1177
  help: string;
1060
1178
  };
1061
1179
  list: {
@@ -1725,12 +1843,55 @@ export declare const routes: {
1725
1843
  readonly name: "id";
1726
1844
  };
1727
1845
  };
1846
+ readonly since: {
1847
+ readonly type: "string";
1848
+ readonly value: {
1849
+ readonly kind: "timestamp";
1850
+ readonly name: "time";
1851
+ readonly description: "Inclusive lower bound. Integer epoch milliseconds or YYYY-MM-DDTHH:mm:ss with Z or a numeric offset. Optional fractional seconds have 1 to 3 digits.";
1852
+ };
1853
+ };
1854
+ readonly until: {
1855
+ readonly type: "string";
1856
+ readonly value: {
1857
+ readonly kind: "timestamp";
1858
+ readonly name: "time";
1859
+ readonly description: "Inclusive upper bound in the same formats as --since. Must be at or after --since.";
1860
+ };
1861
+ };
1862
+ readonly action: {
1863
+ readonly type: "string";
1864
+ readonly multiple: true;
1865
+ readonly value: {
1866
+ readonly kind: "activity-action";
1867
+ readonly name: "action";
1868
+ readonly choices: ("create" | "delete" | "archive" | "edit" | "move" | "order" | "unarchive" | "relation_create" | "relation_delete" | "comment_create" | "comment_edit" | "comment_delete")[];
1869
+ };
1870
+ };
1871
+ readonly changed: {
1872
+ readonly type: "string";
1873
+ readonly multiple: true;
1874
+ readonly value: {
1875
+ readonly kind: "activity-change";
1876
+ readonly name: "field[=value]";
1877
+ readonly pattern: `^((${string})|(${string})=.+)$`;
1878
+ readonly description: `Fields: ${string}. Omit the value to match any change. Values apply to column, priority and added labels, ignoring case. priority=none matches an unassigned priority.`;
1879
+ };
1880
+ };
1728
1881
  readonly limit: {
1729
1882
  readonly type: "string";
1730
1883
  readonly value: {
1731
1884
  readonly kind: "positive-integer";
1732
1885
  readonly name: "n";
1733
- readonly pattern: "^[1-9]\\d{0,14}\\d?$";
1886
+ readonly pattern: string;
1887
+ };
1888
+ readonly description: "Return at most n results after all filters. Use an integer from 1 through 11871.";
1889
+ };
1890
+ readonly "starting-after": {
1891
+ readonly type: "string";
1892
+ readonly value: {
1893
+ readonly kind: "activity-id";
1894
+ readonly name: "id";
1734
1895
  };
1735
1896
  };
1736
1897
  };
@@ -1746,6 +1907,7 @@ export declare const routes: {
1746
1907
  readonly input: "option:show-deleted";
1747
1908
  readonly members: readonly ["option:project", "option:task"];
1748
1909
  }];
1910
+ readonly notes: readonly ["Repeated --action flags match any listed action. Repeated --changed filters for one field match any of them. Different fields must match the same event. All other filters must also match, before --limit applies."];
1749
1911
  };
1750
1912
  results: import("../results.js").CommandResult[];
1751
1913
  run: (args: string[]) => void;