@zinn-dev/cli 0.46.0 → 0.47.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 (53) hide show
  1. package/package.json +2 -2
  2. package/skills/zinn/SKILL.md +1 -1
  3. package/src/capabilities-schema.d.ts +74 -0
  4. package/src/capabilities-schema.js +44 -0
  5. package/src/capabilities.d.ts +2 -0
  6. package/src/capabilities.js +2 -0
  7. package/src/column-hint.js +2 -9
  8. package/src/errors.d.ts +1 -0
  9. package/src/errors.js +1 -0
  10. package/src/input.d.ts +30 -0
  11. package/src/input.js +18 -0
  12. package/src/lib.d.ts +73 -5
  13. package/src/lib.js +69 -13
  14. package/src/presentation/activity-presentation.d.ts +2 -1
  15. package/src/presentation/activity-presentation.js +21 -6
  16. package/src/presentation/color.d.ts +12 -0
  17. package/src/presentation/color.js +12 -0
  18. package/src/presentation/project-presentation.d.ts +4 -1
  19. package/src/presentation/project-presentation.js +18 -0
  20. package/src/presentation/relation-presentation.js +8 -20
  21. package/src/presentation/section.d.ts +7 -4
  22. package/src/presentation/section.js +21 -7
  23. package/src/presentation/task-blame-presentation.d.ts +2 -1
  24. package/src/presentation/task-blame-presentation.js +4 -4
  25. package/src/presentation/task-presentation.d.ts +12 -1
  26. package/src/presentation/task-presentation.js +60 -9
  27. package/src/result-schemas.d.ts +93 -14
  28. package/src/result-schemas.js +1 -0
  29. package/src/routes/activity-router.d.ts +1 -1
  30. package/src/routes/activity-router.js +15 -31
  31. package/src/routes/backup-router.js +2 -9
  32. package/src/routes/capabilities-router.js +2 -9
  33. package/src/routes/comment-router.d.ts +2 -6
  34. package/src/routes/comment-router.js +13 -61
  35. package/src/routes/doctor-router.js +2 -9
  36. package/src/routes/info-router.js +2 -9
  37. package/src/routes/label-router.js +6 -43
  38. package/src/routes/migrate-router.js +2 -9
  39. package/src/routes/project-router.js +14 -100
  40. package/src/routes/reindex-router.js +2 -9
  41. package/src/routes/relation-router.d.ts +10 -4
  42. package/src/routes/relation-router.js +7 -18
  43. package/src/routes/restore-router.js +2 -11
  44. package/src/routes/router.js +32 -11
  45. package/src/routes/routes.d.ts +29 -30
  46. package/src/routes/skill-router.js +3 -18
  47. package/src/routes/task-router.d.ts +28 -28
  48. package/src/routes/task-router.js +62 -195
  49. package/src/routes/whoami-router.js +2 -9
  50. package/src/telemetry.js +3 -4
  51. package/src/types.d.ts +5 -1
  52. package/src/views.d.ts +117 -0
  53. package/src/views.js +54 -0
@@ -1,9 +1,8 @@
1
1
  import { spawn } from "node:child_process";
2
2
  import { homedir } from "node:os";
3
- import { parseArgs } from "node:util";
4
3
  import { CliError } from "../errors.js";
5
4
  import { generateCommandUsage, noInput } from "../input.js";
6
- import { diagnostic, getOutputMode, output, validatePositionals, validateUniqueOptions, } from "../lib.js";
5
+ import { diagnostic, getOutputMode, output, parseCommandArgs, } from "../lib.js";
7
6
  import { jsonResult } from "../results.js";
8
7
  import { formatSkillStatus, presentSkillStatus, } from "../presentation/skill-status-presentation.js";
9
8
  import { bundledSkillDirectory, findSkillCopies, SKILL_NAME } from "../skill-copies.js";
@@ -30,15 +29,7 @@ const skillInputs = {
30
29
  };
31
30
  /** Parses the shared skill command arguments and says whether the command targets the current folder */
32
31
  function parseSkillScope(args) {
33
- const { positionals, values, tokens } = parseArgs({
34
- options: skillScopeInput.options,
35
- args,
36
- strict: true,
37
- allowPositionals: true,
38
- tokens: true,
39
- });
40
- validateUniqueOptions(tokens, skillScopeInput.options);
41
- validatePositionals(positionals, skillScopeInput.forms[0]);
32
+ const { values } = parseCommandArgs(args, skillScopeInput);
42
33
  return values.project === true;
43
34
  }
44
35
  /**
@@ -127,13 +118,7 @@ With --json, the skills CLI's output is reported as notices: on stderr after the
127
118
  input: noInput,
128
119
  results: [jsonResult("SkillStatus")],
129
120
  run: (args) => {
130
- const { positionals } = parseArgs({
131
- options: noInput.options,
132
- args,
133
- strict: true,
134
- allowPositionals: true,
135
- });
136
- validatePositionals(positionals, noInput.forms[0]);
121
+ parseCommandArgs(args, noInput);
137
122
  const workingFolder = process.cwd();
138
123
  const status = presentSkillStatus(findSkillCopies(homedir(), workingFolder), bundledSkillDirectory, workingFolder);
139
124
  output(status, formatSkillStatus);
@@ -1,5 +1,6 @@
1
1
  import type { ParseArgsOptionsConfig } from "node:util";
2
- declare function suggestTaskMove(args: Array<string>, options?: ParseArgsOptionsConfig): string[];
2
+ import type { FlagCorrection } from "../types.js";
3
+ declare function suggestTaskMove(args: Array<string>, options?: ParseArgsOptionsConfig): FlagCorrection;
3
4
  export declare const taskRouter: {
4
5
  create: {
5
6
  summary: string;
@@ -27,6 +28,7 @@ export declare const taskRouter: {
27
28
  readonly kind: "text";
28
29
  readonly name: "text";
29
30
  };
31
+ readonly aliases: readonly ["body"];
30
32
  };
31
33
  readonly "description-file": {
32
34
  readonly type: "string";
@@ -41,7 +43,7 @@ export declare const taskRouter: {
41
43
  readonly value: {
42
44
  readonly kind: "enum";
43
45
  readonly name: "priority";
44
- readonly choices: readonly [...("low" | "medium" | "high" | "urgent")[], "none"];
46
+ readonly choices: readonly [...("urgent" | "high" | "medium" | "low")[], "none"];
45
47
  readonly caseInsensitive: true;
46
48
  readonly description: "Omission leaves priority unassigned on creation and unchanged on edit. none clears priority; JSON uses null.";
47
49
  };
@@ -118,10 +120,6 @@ export declare const taskRouter: {
118
120
  readonly notes: readonly ["Omit the project key to use defaultProject from settings; otherwise a project key is required."];
119
121
  };
120
122
  results: import("../results.js").CommandResult[];
121
- guessedFlags: {
122
- "--status": (args: string[]) => string[];
123
- "--body": (args: string[]) => string[];
124
- };
125
123
  run: (args: string[]) => Promise<void>;
126
124
  help: string;
127
125
  };
@@ -461,23 +459,23 @@ export declare const taskRouter: {
461
459
  readonly name: "text";
462
460
  };
463
461
  };
464
- readonly "expect-title": {
465
- readonly type: "string";
466
- readonly value: {
467
- readonly kind: "text";
468
- readonly name: "text";
469
- };
470
- };
471
462
  readonly "expect-priority": {
472
463
  readonly type: "string";
473
464
  readonly value: {
474
465
  readonly description: "none expects no priority.";
475
466
  readonly kind: "enum";
476
467
  readonly name: "priority";
477
- readonly choices: readonly [...("low" | "medium" | "high" | "urgent")[], "none"];
468
+ readonly choices: readonly [...("urgent" | "high" | "medium" | "low")[], "none"];
478
469
  readonly caseInsensitive: true;
479
470
  };
480
471
  };
472
+ readonly "expect-title": {
473
+ readonly type: "string";
474
+ readonly value: {
475
+ readonly kind: "text";
476
+ readonly name: "text";
477
+ };
478
+ };
481
479
  readonly "expect-due": {
482
480
  readonly type: "string";
483
481
  readonly value: {
@@ -499,7 +497,7 @@ export declare const taskRouter: {
499
497
  readonly value: {
500
498
  readonly kind: "enum";
501
499
  readonly name: "priority";
502
- readonly choices: readonly [...("low" | "medium" | "high" | "urgent")[], "none"];
500
+ readonly choices: readonly [...("urgent" | "high" | "medium" | "low")[], "none"];
503
501
  readonly caseInsensitive: true;
504
502
  readonly description: "Omission leaves priority unassigned on creation and unchanged on edit. none clears priority; JSON uses null.";
505
503
  };
@@ -554,6 +552,7 @@ export declare const taskRouter: {
554
552
  readonly kind: "text";
555
553
  readonly name: "text";
556
554
  };
555
+ readonly aliases: readonly ["body"];
557
556
  };
558
557
  readonly "description-file": {
559
558
  readonly type: "string";
@@ -606,9 +605,8 @@ export declare const taskRouter: {
606
605
  run: (args: string[]) => Promise<void>;
607
606
  help: string;
608
607
  guessedFlags: {
609
- "--status": (args: string[]) => string[];
610
- "--column": (args: string[]) => string[];
611
- "--body": (args: string[]) => string[];
608
+ "--status": (args: string[]) => FlagCorrection;
609
+ "--column": (args: string[]) => FlagCorrection;
612
610
  };
613
611
  };
614
612
  move: {
@@ -954,7 +952,7 @@ export declare const taskRouter: {
954
952
  readonly required: true;
955
953
  readonly value: {
956
954
  readonly kind: "enum";
957
- readonly choices: ("related" | "dependency" | "duplicate" | "subtask")[];
955
+ readonly choices: ("dependency" | "subtask" | "duplicate" | "related")[];
958
956
  };
959
957
  };
960
958
  };
@@ -980,7 +978,10 @@ export declare const taskRouter: {
980
978
  };
981
979
  results: import("../results.js").CommandResult[];
982
980
  guessedFlags: {
983
- [k: string]: (args: Array<string>) => string[] | undefined;
981
+ [k: string]: (args: Array<string>) => {
982
+ args: string[];
983
+ guidance: string;
984
+ } | undefined;
984
985
  };
985
986
  run: (args: string[]) => Promise<void>;
986
987
  help: string;
@@ -1031,7 +1032,7 @@ export declare const taskRouter: {
1031
1032
  readonly required: true;
1032
1033
  readonly value: {
1033
1034
  readonly kind: "enum";
1034
- readonly choices: ("related" | "dependency" | "duplicate" | "subtask")[];
1035
+ readonly choices: ("dependency" | "subtask" | "duplicate" | "related")[];
1035
1036
  };
1036
1037
  };
1037
1038
  };
@@ -1057,7 +1058,10 @@ export declare const taskRouter: {
1057
1058
  };
1058
1059
  results: import("../results.js").CommandResult[];
1059
1060
  guessedFlags: {
1060
- [k: string]: (args: Array<string>) => string[] | undefined;
1061
+ [k: string]: (args: Array<string>) => {
1062
+ args: string[];
1063
+ guidance: string;
1064
+ } | undefined;
1061
1065
  };
1062
1066
  run: (args: string[]) => void;
1063
1067
  help: string;
@@ -1082,6 +1086,7 @@ export declare const taskRouter: {
1082
1086
  readonly kind: "text";
1083
1087
  readonly name: "text";
1084
1088
  };
1089
+ readonly aliases: readonly ["body"];
1085
1090
  };
1086
1091
  readonly "text-file": {
1087
1092
  readonly type: "string";
@@ -1112,9 +1117,6 @@ export declare const taskRouter: {
1112
1117
  }];
1113
1118
  };
1114
1119
  results: import("../results.js").CommandResult[];
1115
- guessedFlags: {
1116
- "--body": (args: string[]) => string[];
1117
- };
1118
1120
  run: (args: string[]) => Promise<void>;
1119
1121
  help: string;
1120
1122
  };
@@ -1222,6 +1224,7 @@ export declare const taskRouter: {
1222
1224
  readonly kind: "text";
1223
1225
  readonly name: "text";
1224
1226
  };
1227
+ readonly aliases: readonly ["body"];
1225
1228
  };
1226
1229
  readonly "text-file": {
1227
1230
  readonly type: "string";
@@ -1271,9 +1274,6 @@ export declare const taskRouter: {
1271
1274
  readonly notes: readonly [string, string];
1272
1275
  };
1273
1276
  results: import("../results.js").CommandResult[];
1274
- guessedFlags: {
1275
- "--body": (args: string[]) => string[];
1276
- };
1277
1277
  run: (args: string[]) => Promise<void>;
1278
1278
  help: string;
1279
1279
  };