flowcat 1.4.4 → 1.6.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.
@@ -0,0 +1,115 @@
1
+ ; Query from: https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/99ddf573531c4dbe53f743ecbc1595af5eb1d32f/queries/markdown_inline/highlights.scm
2
+ ; From MDeiml/tree-sitter-markdown
3
+ (code_span) @markup.raw @nospell
4
+
5
+ (emphasis) @markup.italic
6
+
7
+ (strong_emphasis) @markup.strong
8
+
9
+ (strikethrough) @markup.strikethrough
10
+
11
+ (shortcut_link
12
+ (link_text) @nospell)
13
+
14
+ [
15
+ (backslash_escape)
16
+ (hard_line_break)
17
+ ] @string.escape
18
+
19
+ ; Conceal codeblock and text style markers
20
+ ([
21
+ (code_span_delimiter)
22
+ (emphasis_delimiter)
23
+ ] @conceal
24
+ (#set! conceal ""))
25
+
26
+ ; Inline links - style all parts
27
+ (inline_link
28
+ ["[" "(" ")"] @markup.link)
29
+
30
+ (inline_link
31
+ "]" @markup.link.bracket.close)
32
+
33
+ ; Conceal opening bracket
34
+ ((inline_link
35
+ "[" @conceal)
36
+ (#set! conceal ""))
37
+
38
+ ; Conceal closing bracket with space replacement
39
+ ((inline_link
40
+ "]" @conceal)
41
+ (#set! conceal " "))
42
+
43
+ ; Conceal image links
44
+ (image
45
+ [
46
+ "!"
47
+ "["
48
+ "]"
49
+ "("
50
+ (link_destination)
51
+ ")"
52
+ ] @markup.link
53
+ (#set! conceal ""))
54
+
55
+ ; Conceal full reference links
56
+ (full_reference_link
57
+ [
58
+ "["
59
+ "]"
60
+ (link_label)
61
+ ] @markup.link
62
+ (#set! conceal ""))
63
+
64
+ ; Conceal collapsed reference links
65
+ (collapsed_reference_link
66
+ [
67
+ "["
68
+ "]"
69
+ ] @markup.link
70
+ (#set! conceal ""))
71
+
72
+ ; Conceal shortcut links
73
+ (shortcut_link
74
+ [
75
+ "["
76
+ "]"
77
+ ] @markup.link
78
+ (#set! conceal ""))
79
+
80
+ [
81
+ (link_destination)
82
+ (uri_autolink)
83
+ ] @markup.link.url @nospell
84
+
85
+ [
86
+ (link_label)
87
+ (link_text)
88
+ (link_title)
89
+ (image_description)
90
+ ] @markup.link.label
91
+
92
+ ; Replace common HTML entities.
93
+ ((entity_reference) @character.special
94
+ (#eq? @character.special " ")
95
+ (#set! conceal ""))
96
+
97
+ ((entity_reference) @character.special
98
+ (#eq? @character.special "<")
99
+ (#set! conceal "<"))
100
+
101
+ ((entity_reference) @character.special
102
+ (#eq? @character.special "&gt;")
103
+ (#set! conceal ">"))
104
+
105
+ ((entity_reference) @character.special
106
+ (#eq? @character.special "&amp;")
107
+ (#set! conceal "&"))
108
+
109
+ ((entity_reference) @character.special
110
+ (#eq? @character.special "&quot;")
111
+ (#set! conceal "\""))
112
+
113
+ ((entity_reference) @character.special
114
+ (#any-of? @character.special "&ensp;" "&emsp;")
115
+ (#set! conceal " "))
package/dist/index.mjs CHANGED
@@ -30789,7 +30789,7 @@ var registerEditCommand = (program2, helpers) => {
30789
30789
  }));
30790
30790
  };
30791
30791
 
30792
- // initFlow.ts
30792
+ // ../../packages/core/src/initFlow.ts
30793
30793
  import path8 from "node:path";
30794
30794
 
30795
30795
  // ../../packages/core/src/gitignore.ts
@@ -30820,7 +30820,7 @@ var ensureWorkspaceIgnored = async (repoRoot) => {
30820
30820
  return true;
30821
30821
  };
30822
30822
 
30823
- // initFlow.ts
30823
+ // ../../packages/core/src/initFlow.ts
30824
30824
  var selectWorkspace = async (cwd, force, store) => {
30825
30825
  if (store) {
30826
30826
  return { workspaceRoot: path8.resolve(store), kind: "explicit" };
@@ -32260,11 +32260,142 @@ var resolvePackageVersion = async () => {
32260
32260
  }
32261
32261
  };
32262
32262
 
32263
+ // outputSchemas.ts
32264
+ var outputSchemas = {
32265
+ add: `{
32266
+ task: Task,
32267
+ alias: string
32268
+ }`,
32269
+ list: `{
32270
+ selection: "all" | TaskStatus | "today" | "yesterday" | "this_week" | "last_week",
32271
+ tasks: Array<{
32272
+ task: Task,
32273
+ status: TaskStatus,
32274
+ alias: string | null
32275
+ }>
32276
+ }`,
32277
+ show: `{
32278
+ task: Task,
32279
+ alias: string | null
32280
+ }`,
32281
+ search: `{
32282
+ query: string,
32283
+ tasks: Array<{
32284
+ task: Task,
32285
+ status: TaskStatus,
32286
+ alias: string | null
32287
+ }>
32288
+ }`,
32289
+ edit: `{
32290
+ task: Task
32291
+ }`,
32292
+ log: `{
32293
+ task: Task
32294
+ }`,
32295
+ start: `{
32296
+ task: Task,
32297
+ nextStatus: "active"
32298
+ }`,
32299
+ pause: `{
32300
+ task: Task,
32301
+ nextStatus: "paused"
32302
+ }`,
32303
+ complete: `{
32304
+ task: Task,
32305
+ nextStatus: "completed"
32306
+ }`,
32307
+ cancel: `{
32308
+ task: Task,
32309
+ nextStatus: "cancelled"
32310
+ }`,
32311
+ today: `{
32312
+ status: "assigned" | "already_assigned",
32313
+ task: Task,
32314
+ date: string, // YYYY-MM-DD
32315
+ order?: number // position in day list (only if status is "assigned")
32316
+ }`,
32317
+ "today move": `{
32318
+ status: "moved" | "no_change" | "not_assigned",
32319
+ task: Task,
32320
+ date: string, // YYYY-MM-DD
32321
+ position?: number // new position (only if status is "moved" or "no_change")
32322
+ }`,
32323
+ untoday: `{
32324
+ status: "unassigned" | "already_unassigned",
32325
+ task: Task,
32326
+ date: string // YYYY-MM-DD
32327
+ }`,
32328
+ "attach-pr": `{
32329
+ status: "attached" | "updated",
32330
+ task: Task
32331
+ }`,
32332
+ refresh: `{
32333
+ status: "no_pr" | "refreshed" | "no_change" | "merged" | "closed",
32334
+ task: Task
32335
+ }`,
32336
+ init: `{
32337
+ workspace: {
32338
+ workspaceRoot: string,
32339
+ kind: "repo" | "global"
32340
+ }
32341
+ }`,
32342
+ where: `{
32343
+ workspace: {
32344
+ root: string,
32345
+ kind: "repo" | "global"
32346
+ }
32347
+ }`,
32348
+ "alias reconcile": `{
32349
+ status: "reconciled"
32350
+ }`
32351
+ };
32352
+ var taskTypeDefinition = `
32353
+ Task = {
32354
+ id: string, // T<ULID> or R<ULID>
32355
+ ref: string, // T-XXXXXX or R-XXXXXX (stable reference)
32356
+ type: "regular" | "review",
32357
+ title: string,
32358
+ status: TaskStatus,
32359
+ created_at: string, // ISO 8601
32360
+ updated_at: string, // ISO 8601
32361
+ metadata: {
32362
+ url?: string,
32363
+ pr?: {
32364
+ url: string,
32365
+ owner: string,
32366
+ repo: string,
32367
+ number: number,
32368
+ fetched?: {
32369
+ title: string,
32370
+ state: "open" | "closed" | "merged",
32371
+ merged: boolean,
32372
+ author: string,
32373
+ updated_at: string,
32374
+ fetched_at: string
32375
+ }
32376
+ }
32377
+ },
32378
+ logs: Array<{
32379
+ ts: string, // ISO 8601
32380
+ msg: string,
32381
+ status?: TaskStatus
32382
+ }>,
32383
+ day_assignments: Array<{
32384
+ date: string, // YYYY-MM-DD
32385
+ action: "assign" | "unassign",
32386
+ ts: string, // ISO 8601
32387
+ order?: number
32388
+ }>
32389
+ }
32390
+
32391
+ TaskStatus = "backlog" | "active" | "paused" | "completed" | "cancelled"
32392
+ `;
32393
+
32263
32394
  // index.ts
32264
32395
  var program2 = new Command;
32265
32396
  var helpers = createCliHelpers(program2);
32266
32397
  var packageVersion = await resolvePackageVersion();
32267
- program2.name("flowcat").description("Terminal task manager").option("--store <path>", "explicit workspace path").option("--global", "use global workspace").option("--repo", "use repo workspace").option("--json", "print JSON output").option("--help-all", "display full manual with all commands");
32398
+ program2.name("flowcat").description("Terminal task manager").option("--store <path>", "explicit workspace path").option("--global", "use global workspace").option("--repo", "use repo workspace").option("--json", "print JSON output").option("--help-all", "show full help; use <command> --help-all for JSON output schema").configureHelp({ showGlobalOptions: true });
32268
32399
  if (packageVersion) {
32269
32400
  program2.version(packageVersion);
32270
32401
  }
@@ -32304,8 +32435,49 @@ ${"─".repeat(60)}
32304
32435
  return sections.join(`
32305
32436
  `);
32306
32437
  };
32438
+ var generateCommandHelpAll = (cmd, cmdPath) => {
32439
+ const sections = [];
32440
+ sections.push(cmd.helpInformation());
32441
+ const schema = outputSchemas[cmdPath];
32442
+ if (schema) {
32443
+ sections.push(`
32444
+ JSON Output (--json):`);
32445
+ sections.push(schema.split(`
32446
+ `).map((line) => ` ${line}`).join(`
32447
+ `));
32448
+ sections.push(`
32449
+ Type Definitions:`);
32450
+ sections.push(taskTypeDefinition.trim().split(`
32451
+ `).map((line) => ` ${line}`).join(`
32452
+ `));
32453
+ }
32454
+ return sections.join(`
32455
+ `);
32456
+ };
32457
+ var findCommand = (program3, args) => {
32458
+ let current = program3;
32459
+ const pathParts = [];
32460
+ for (const arg of args) {
32461
+ if (arg.startsWith("-"))
32462
+ continue;
32463
+ const sub = current.commands.find((c) => c.name() === arg || c.aliases().includes(arg));
32464
+ if (!sub)
32465
+ break;
32466
+ current = sub;
32467
+ pathParts.push(sub.name());
32468
+ }
32469
+ if (pathParts.length === 0)
32470
+ return null;
32471
+ return { cmd: current, path: pathParts.join(" ") };
32472
+ };
32307
32473
  if (process.argv.includes("--help-all")) {
32308
- process.stdout.write(generateFullHelp(program2));
32474
+ const argsBeforeFlag = process.argv.slice(2, process.argv.indexOf("--help-all"));
32475
+ const found = findCommand(program2, argsBeforeFlag);
32476
+ if (found) {
32477
+ process.stdout.write(generateCommandHelpAll(found.cmd, found.path));
32478
+ } else {
32479
+ process.stdout.write(generateFullHelp(program2));
32480
+ }
32309
32481
  process.exit(0);
32310
32482
  }
32311
32483
  if (process.argv.length <= 2) {
@@ -0,0 +1,27 @@
1
+ ; Query from: https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/markdown/injections.scm
2
+ (fenced_code_block
3
+ (info_string
4
+ (language) @_lang)
5
+ (code_fence_content) @injection.content
6
+ (#set-lang-from-info-string! @_lang))
7
+
8
+ ((html_block) @injection.content
9
+ (#set! injection.language "html")
10
+ (#set! injection.combined)
11
+ (#set! injection.include-children))
12
+
13
+ ((minus_metadata) @injection.content
14
+ (#set! injection.language "yaml")
15
+ (#offset! @injection.content 1 0 -1 0)
16
+ (#set! injection.include-children))
17
+
18
+ ((plus_metadata) @injection.content
19
+ (#set! injection.language "toml")
20
+ (#offset! @injection.content 1 0 -1 0)
21
+ (#set! injection.include-children))
22
+
23
+ ([
24
+ (inline)
25
+ (pipe_table_cell)
26
+ ] @injection.content
27
+ (#set! injection.language "markdown_inline"))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowcat",
3
- "version": "1.4.4",
3
+ "version": "1.6.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "bin": {
11
11
  "flowcat": "dist/index.mjs",
12
- "fc": "dist/index.mjs"
12
+ "fc": "dist/fc.mjs"
13
13
  },
14
14
  "files": [
15
15
  "dist",
@@ -35,7 +35,7 @@
35
35
  "lint:fix": "bunx biome lint --write .",
36
36
  "format": "bunx biome format --write .",
37
37
  "typecheck": "bunx tsc --noEmit",
38
- "test:unit": "bunx vitest run __tests__",
38
+ "test:unit": "bunx vitest run __tests__ --passWithNoTests",
39
39
  "test:e2e": "E2E=1 bunx vitest run e2e",
40
40
  "test:e2e:watch": "E2E=1 bunx vitest e2e",
41
41
  "release": "semantic-release",