@enrichlayer/el-linear 1.7.0 → 1.10.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 (108) hide show
  1. package/README.md +82 -1
  2. package/claude-skills/linear-operations/SKILL.md +55 -0
  3. package/dist/auth/oauth-callback.js +14 -7
  4. package/dist/auth/oauth-fs.d.ts +22 -0
  5. package/dist/auth/oauth-fs.js +77 -6
  6. package/dist/auth/oauth-headless.d.ts +13 -8
  7. package/dist/auth/oauth-headless.js +18 -11
  8. package/dist/auth/oauth-storage.d.ts +11 -3
  9. package/dist/auth/oauth-storage.js +15 -8
  10. package/dist/auth/token-resolver.d.ts +9 -0
  11. package/dist/auth/token-resolver.js +57 -37
  12. package/dist/commands/attachments.js +2 -1
  13. package/dist/commands/comments.js +17 -28
  14. package/dist/commands/cycles.js +2 -1
  15. package/dist/commands/documents.js +2 -1
  16. package/dist/commands/graphql.js +4 -6
  17. package/dist/commands/init/index.js +2 -0
  18. package/dist/commands/init/oauth.d.ts +6 -0
  19. package/dist/commands/init/oauth.js +8 -2
  20. package/dist/commands/init/token.d.ts +0 -8
  21. package/dist/commands/init/token.js +13 -1
  22. package/dist/commands/issue-id.js +1 -3
  23. package/dist/commands/issues/branch.d.ts +17 -0
  24. package/dist/commands/issues/branch.js +40 -0
  25. package/dist/commands/issues/description.d.ts +89 -0
  26. package/dist/commands/issues/description.js +183 -0
  27. package/dist/commands/issues/link-references.d.ts +21 -0
  28. package/dist/commands/issues/link-references.js +171 -0
  29. package/dist/commands/issues/relations.d.ts +55 -0
  30. package/dist/commands/issues/relations.js +132 -0
  31. package/dist/commands/issues.js +97 -497
  32. package/dist/commands/labels.js +20 -28
  33. package/dist/commands/profile/migrate-legacy.js +10 -33
  34. package/dist/commands/profile.js +1 -10
  35. package/dist/commands/project-milestones.js +13 -20
  36. package/dist/commands/projects.d.ts +5 -1
  37. package/dist/commands/projects.js +202 -102
  38. package/dist/commands/read-shortcut.d.ts +6 -0
  39. package/dist/commands/read-shortcut.js +6 -1
  40. package/dist/commands/refs.js +10 -1
  41. package/dist/commands/releases.js +26 -30
  42. package/dist/commands/search.js +21 -30
  43. package/dist/commands/teams.js +2 -1
  44. package/dist/commands/templates.js +128 -7
  45. package/dist/commands/users.js +3 -1
  46. package/dist/config/config.js +31 -9
  47. package/dist/config/issue-validation.js +1 -1
  48. package/dist/config/paths.d.ts +11 -0
  49. package/dist/config/paths.js +44 -6
  50. package/dist/config/resolver.js +2 -3
  51. package/dist/config/term-enforcer.js +1 -1
  52. package/dist/main.js +37 -2
  53. package/dist/queries/attachments-types.d.ts +30 -0
  54. package/dist/queries/attachments-types.js +5 -0
  55. package/dist/queries/comments-types.d.ts +49 -0
  56. package/dist/queries/comments-types.js +5 -0
  57. package/dist/queries/documents-types.d.ts +61 -0
  58. package/dist/queries/documents-types.js +9 -0
  59. package/dist/queries/introspect-types.d.ts +57 -0
  60. package/dist/queries/introspect-types.js +10 -0
  61. package/dist/queries/issues-types.d.ts +416 -0
  62. package/dist/queries/issues-types.js +23 -0
  63. package/dist/queries/issues.d.ts +2 -0
  64. package/dist/queries/issues.js +22 -0
  65. package/dist/queries/labels-types.d.ts +64 -0
  66. package/dist/queries/labels-types.js +5 -0
  67. package/dist/queries/project-milestones-types.d.ts +91 -0
  68. package/dist/queries/project-milestones-types.js +10 -0
  69. package/dist/queries/projects-types.d.ts +75 -0
  70. package/dist/queries/projects-types.js +5 -0
  71. package/dist/queries/projects.d.ts +2 -0
  72. package/dist/queries/projects.js +22 -0
  73. package/dist/queries/releases-types.d.ts +84 -0
  74. package/dist/queries/releases-types.js +5 -0
  75. package/dist/queries/search-types.d.ts +86 -0
  76. package/dist/queries/search-types.js +6 -0
  77. package/dist/queries/templates-types.d.ts +61 -0
  78. package/dist/queries/templates-types.js +9 -0
  79. package/dist/queries/templates.d.ts +3 -0
  80. package/dist/queries/templates.js +43 -0
  81. package/dist/types/linear.d.ts +8 -2
  82. package/dist/utils/auth.js +7 -9
  83. package/dist/utils/auto-link-references.js +44 -25
  84. package/dist/utils/disk-cache.js +2 -1
  85. package/dist/utils/formatters/summary.d.ts +62 -0
  86. package/dist/utils/formatters/summary.js +755 -0
  87. package/dist/utils/graphql-attachments-service.js +6 -9
  88. package/dist/utils/graphql-documents-service.js +19 -25
  89. package/dist/utils/graphql-issues-service.d.ts +118 -5
  90. package/dist/utils/graphql-issues-service.js +202 -209
  91. package/dist/utils/issue-reference-extractor.d.ts +9 -1
  92. package/dist/utils/issue-reference-extractor.js +16 -9
  93. package/dist/utils/issue-reference-wrapper.js +1 -54
  94. package/dist/utils/linear-service.d.ts +7 -3
  95. package/dist/utils/linear-service.js +27 -5
  96. package/dist/utils/markdown-prosemirror.js +17 -1
  97. package/dist/utils/mention-resolver.js +17 -5
  98. package/dist/utils/output.d.ts +7 -1
  99. package/dist/utils/output.js +38 -1
  100. package/dist/utils/protected-ranges.d.ts +33 -0
  101. package/dist/utils/protected-ranges.js +73 -0
  102. package/dist/utils/table-formatter.d.ts +36 -0
  103. package/dist/utils/table-formatter.js +46 -24
  104. package/dist/utils/validators.d.ts +9 -1
  105. package/dist/utils/validators.js +10 -0
  106. package/dist/utils/workspace-url.d.ts +5 -1
  107. package/dist/utils/workspace-url.js +35 -5
  108. package/package.json +1 -1
@@ -25,6 +25,7 @@ import { randomBytes } from "node:crypto";
25
25
  import fs from "node:fs/promises";
26
26
  import path from "node:path";
27
27
  import { resolveActiveProfile } from "../config/paths.js";
28
+ import { logger } from "./logger.js";
28
29
  const CACHE_VERSION = 1;
29
30
  const CACHE_FILE_MODE = 0o644;
30
31
  const CACHE_DIR_MODE = 0o700;
@@ -138,7 +139,7 @@ export async function cached(key, ttlSeconds, fetcher, options) {
138
139
  // Cache writes are best-effort — log to stderr and return the data
139
140
  // anyway so a flaky disk doesn't break the user's command.
140
141
  const msg = err instanceof Error ? err.message : String(err);
141
- process.stderr.write(`[disk-cache] write failed for "${key}": ${msg}\n`);
142
+ logger.error(`[disk-cache] write failed for "${key}": ${msg}`);
142
143
  }
143
144
  return data;
144
145
  }
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Human-readable summary formatters for the `--format summary` output mode.
3
+ *
4
+ * These are pure functions: each takes the same shape that the JSON output
5
+ * path receives (a single resource object or a `{ data, meta }` envelope)
6
+ * and returns a plain string suitable for terminal display.
7
+ *
8
+ * Why this exists: every consumer (humans and LLMs) was piping
9
+ * `el-linear ... | python -c 'json.load(...)'` or jq-based extraction to
10
+ * pull out title/state/assignee. This codifies that recurring shape as a
11
+ * first-class output mode, so callers don't reinvent it in shell.
12
+ *
13
+ * The summary format is intentionally stable — it's a contract, not a
14
+ * pretty-print. Field ordering and labels should not change across
15
+ * patch releases without a CHANGELOG entry.
16
+ */
17
+ export declare function formatIssueSummary(issue: Record<string, unknown>): string;
18
+ export declare function formatIssueList(issues: unknown[]): string;
19
+ export declare function formatProjectSummary(project: Record<string, unknown>): string;
20
+ export declare function formatProjectList(projects: unknown[]): string;
21
+ export declare function formatCommentSummary(comment: Record<string, unknown>): string;
22
+ export declare function formatCommentList(comments: unknown[]): string;
23
+ export declare function formatCycleSummary(cycle: Record<string, unknown>): string;
24
+ export declare function formatCycleList(cycles: unknown[]): string;
25
+ export declare function formatMilestoneSummary(milestone: Record<string, unknown>): string;
26
+ export declare function formatMilestoneList(milestones: unknown[]): string;
27
+ export declare function formatTeamList(teams: unknown[]): string;
28
+ export declare function formatLabelList(labels: unknown[]): string;
29
+ export declare function formatUserSummary(user: Record<string, unknown>): string;
30
+ export declare function formatUserList(users: unknown[]): string;
31
+ export declare function formatDocumentSummary(doc: Record<string, unknown>): string;
32
+ export declare function formatDocumentList(docs: unknown[]): string;
33
+ export declare function formatTemplateSummary(tpl: Record<string, unknown>): string;
34
+ export declare function formatTemplateList(tpls: unknown[]): string;
35
+ export declare function formatAttachmentList(attachments: unknown[]): string;
36
+ export declare function formatReleaseSummary(release: Record<string, unknown>): string;
37
+ export declare function formatReleaseList(releases: unknown[]): string;
38
+ export declare function formatSearchResultList(results: unknown[]): string;
39
+ /**
40
+ * Generic fallback for resources we don't have a dedicated formatter for
41
+ * yet (e.g. profile/config/template/document). Renders any object as a
42
+ * label-padded key/value block, with a "..." footer hinting at JSON for
43
+ * the full payload. Lists fall back to a simple bulleted list.
44
+ */
45
+ export declare function formatGenericSummary(value: unknown): string;
46
+ export type ResourceKind = "issue" | "issue-list" | "project" | "project-list" | "comment" | "comment-list" | "cycle" | "cycle-list" | "milestone" | "milestone-list" | "team-list" | "label-list" | "user" | "user-list" | "document" | "document-list" | "template" | "template-list" | "attachment-list" | "release" | "release-list" | "search-result-list" | "empty-list" | "generic";
47
+ /**
48
+ * Heuristic — used by the central `outputSuccess` path which doesn't know
49
+ * which command produced the payload. Looks at the shape of the data to
50
+ * pick a formatter.
51
+ *
52
+ * Single-resource detection: uses signature fields (e.g. `identifier` +
53
+ * `state` for issues, `name` + `progress` for projects). When a payload
54
+ * doesn't match any known shape we fall through to `formatGenericSummary`.
55
+ */
56
+ export declare function inferKindFromPayload(value: unknown): ResourceKind;
57
+ /**
58
+ * Central dispatch: given a resource kind and payload, return the
59
+ * formatted string. The payload for list kinds may be either the raw
60
+ * array or a `{ data: [...] }` envelope — both are handled.
61
+ */
62
+ export declare function dispatch(kind: ResourceKind, payload: unknown): string;