@hasna/todos 0.10.19 → 0.10.21

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,51 @@
1
+ import type { Task, TaskPriority } from "../types/index.js";
2
+ import type { Database } from "bun:sqlite";
3
+ export declare const EXTRACT_TAGS: readonly ["TODO", "FIXME", "HACK", "XXX", "BUG", "NOTE"];
4
+ export type ExtractTag = (typeof EXTRACT_TAGS)[number];
5
+ export interface ExtractedComment {
6
+ tag: ExtractTag;
7
+ message: string;
8
+ file: string;
9
+ line: number;
10
+ /** Full line content from the source file */
11
+ raw: string;
12
+ }
13
+ export interface ExtractOptions {
14
+ /** Directory or file to scan */
15
+ path: string;
16
+ /** Comment tags to look for (default: all) */
17
+ patterns?: ExtractTag[];
18
+ /** Project ID to assign tasks to */
19
+ project_id?: string;
20
+ /** Task list ID */
21
+ task_list_id?: string;
22
+ /** Extra tags to add to created tasks */
23
+ tags?: string[];
24
+ /** Agent to assign tasks to */
25
+ assigned_to?: string;
26
+ /** Agent ID performing the extraction */
27
+ agent_id?: string;
28
+ /** If true, return extracted comments without creating tasks */
29
+ dry_run?: boolean;
30
+ /** File extensions to scan (default: common code extensions) */
31
+ extensions?: string[];
32
+ }
33
+ export interface ExtractResult {
34
+ /** All comments found */
35
+ comments: ExtractedComment[];
36
+ /** Tasks created (empty if dry_run) */
37
+ tasks: Task[];
38
+ /** Number of duplicates skipped */
39
+ skipped: number;
40
+ }
41
+ /** Priority mapping from comment tag */
42
+ export declare function tagToPriority(tag: ExtractTag): TaskPriority;
43
+ /**
44
+ * Extract TODO-style comments from a single file's contents.
45
+ */
46
+ export declare function extractFromSource(source: string, filePath: string, tags?: ExtractTag[]): ExtractedComment[];
47
+ /**
48
+ * Scan a directory or file for TODO-style comments and optionally create tasks.
49
+ */
50
+ export declare function extractTodos(options: ExtractOptions, db?: Database): ExtractResult;
51
+ //# sourceMappingURL=extract.d.ts.map
@@ -0,0 +1 @@
1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,GAAG,EAAE,UAAU,GAAG,YAAY,CAa3D;AAiBD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,UAAU,EAAsB,GACrC,gBAAgB,EAAE,CA0BpB;AA+BD;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,aAAa,CAuFlF"}
@@ -0,0 +1,25 @@
1
+ import type { CreateTaskInput } from "../types/index.js";
2
+ export interface GitHubIssue {
3
+ number: number;
4
+ title: string;
5
+ body: string | null;
6
+ labels: string[];
7
+ state: string;
8
+ assignee: string | null;
9
+ url: string;
10
+ }
11
+ /** Parse a GitHub issue URL into owner/repo/number */
12
+ export declare function parseGitHubUrl(url: string): {
13
+ owner: string;
14
+ repo: string;
15
+ number: number;
16
+ } | null;
17
+ /** Fetch a GitHub issue using the gh CLI */
18
+ export declare function fetchGitHubIssue(owner: string, repo: string, number: number): GitHubIssue;
19
+ /** Convert a GitHub issue to a CreateTaskInput */
20
+ export declare function issueToTask(issue: GitHubIssue, opts?: {
21
+ project_id?: string;
22
+ task_list_id?: string;
23
+ agent_id?: string;
24
+ }): CreateTaskInput;
25
+ //# sourceMappingURL=github.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/lib/github.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,sDAAsD;AACtD,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAIlG;AAED,4CAA4C;AAC5C,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAezF;AAED,kDAAkD;AAClD,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,eAAe,CAuBzI"}