@uniswap/ai-toolkit-linear-task-utils 0.0.4 → 0.0.5-next.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.
package/dist/cli.cjs CHANGED
@@ -12998,6 +12998,17 @@ var DEFAULTS = {
12998
12998
  function slugify(text, maxLength = 50) {
12999
12999
  return text.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").substring(0, maxLength).replace(/-+$/, "");
13000
13000
  }
13001
+ var TRUNCATION_SUFFIX = "\n\n[Description truncated for workflow. See full issue in Linear.]";
13002
+ function truncateDescription(text, maxLength = 4e3) {
13003
+ if (!text || text.length <= maxLength) {
13004
+ return text;
13005
+ }
13006
+ const effectiveMax = maxLength - TRUNCATION_SUFFIX.length;
13007
+ const truncated = text.substring(0, effectiveMax);
13008
+ const lastSpace = truncated.lastIndexOf(" ");
13009
+ const breakPoint = lastSpace > effectiveMax * 0.8 ? lastSpace : effectiveMax;
13010
+ return truncated.substring(0, breakPoint) + TRUNCATION_SUFFIX;
13011
+ }
13001
13012
  function generateBranchName(identifier, title) {
13002
13013
  const slug = slugify(title, 40);
13003
13014
  return slug ? `claude/${identifier.toLowerCase()}-${slug}` : `claude/${identifier.toLowerCase()}`;
@@ -13029,7 +13040,7 @@ async function queryIssues(client, config) {
13029
13040
  issue_id: issue.id,
13030
13041
  issue_identifier: issue.identifier,
13031
13042
  issue_title: issue.title,
13032
- issue_description: issue.description || "",
13043
+ issue_description: truncateDescription(issue.description || ""),
13033
13044
  issue_url: issue.url,
13034
13045
  branch_name: generateBranchName(issue.identifier, issue.title),
13035
13046
  priority: issue.priority ?? 0,
@@ -13202,7 +13213,7 @@ function parseUpdateIssueConfig(args2) {
13202
13213
  }
13203
13214
 
13204
13215
  // packages/linear-task-utils/src/version.ts
13205
- var VERSION = "0.0.3";
13216
+ var VERSION = "0.0.4";
13206
13217
 
13207
13218
  // packages/linear-task-utils/src/cli.ts
13208
13219
  var RED = "\x1B[0;31m";
package/dist/index.cjs CHANGED
@@ -12765,6 +12765,7 @@ __export(index_exports, {
12765
12765
  parseQueryConfig: () => parseQueryConfig,
12766
12766
  parseUpdateIssueConfig: () => parseUpdateIssueConfig,
12767
12767
  queryIssues: () => queryIssues,
12768
+ truncateDescription: () => truncateDescription,
12768
12769
  updateIssue: () => updateIssue
12769
12770
  });
12770
12771
  module.exports = __toCommonJS(index_exports);
@@ -12792,6 +12793,17 @@ var import_sdk = __toESM(require_index_cjs_min());
12792
12793
  function slugify(text, maxLength = 50) {
12793
12794
  return text.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").substring(0, maxLength).replace(/-+$/, "");
12794
12795
  }
12796
+ var TRUNCATION_SUFFIX = "\n\n[Description truncated for workflow. See full issue in Linear.]";
12797
+ function truncateDescription(text, maxLength = 4e3) {
12798
+ if (!text || text.length <= maxLength) {
12799
+ return text;
12800
+ }
12801
+ const effectiveMax = maxLength - TRUNCATION_SUFFIX.length;
12802
+ const truncated = text.substring(0, effectiveMax);
12803
+ const lastSpace = truncated.lastIndexOf(" ");
12804
+ const breakPoint = lastSpace > effectiveMax * 0.8 ? lastSpace : effectiveMax;
12805
+ return truncated.substring(0, breakPoint) + TRUNCATION_SUFFIX;
12806
+ }
12795
12807
  function generateBranchName(identifier, title) {
12796
12808
  const slug = slugify(title, 40);
12797
12809
  return slug ? `claude/${identifier.toLowerCase()}-${slug}` : `claude/${identifier.toLowerCase()}`;
@@ -12823,7 +12835,7 @@ async function queryIssues(client, config) {
12823
12835
  issue_id: issue.id,
12824
12836
  issue_identifier: issue.identifier,
12825
12837
  issue_title: issue.title,
12826
- issue_description: issue.description || "",
12838
+ issue_description: truncateDescription(issue.description || ""),
12827
12839
  issue_url: issue.url,
12828
12840
  branch_name: generateBranchName(issue.identifier, issue.title),
12829
12841
  priority: issue.priority ?? 0,
@@ -13005,5 +13017,6 @@ function parseUpdateIssueConfig(args) {
13005
13017
  parseQueryConfig,
13006
13018
  parseUpdateIssueConfig,
13007
13019
  queryIssues,
13020
+ truncateDescription,
13008
13021
  updateIssue
13009
13022
  });
@@ -1,5 +1,14 @@
1
1
  import { LinearClient } from '@linear/sdk';
2
2
  import type { QueryConfig, MatrixOutput } from './types.js';
3
+ /**
4
+ * Truncate text to a maximum length with ellipsis indicator
5
+ * GitHub Actions has limits on output/matrix sizes, so we truncate large descriptions
6
+ *
7
+ * @param text - The text to truncate
8
+ * @param maxLength - Maximum total length including the truncation suffix (default: 4000)
9
+ * @returns The original text if under maxLength, or truncated text with suffix
10
+ */
11
+ export declare function truncateDescription(text: string, maxLength?: number): string;
3
12
  /**
4
13
  * Query Linear for issues matching the specified criteria
5
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"query-issues.d.ts","sourceRoot":"","sources":["../../../../src/query-issues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAkB,YAAY,EAAE,MAAM,YAAY,CAAC;AAyB5E;;GAEG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,YAAY,CAAC,CA4DvB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAMhE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,WAAW,CA6Bd"}
1
+ {"version":3,"file":"query-issues.d.ts","sourceRoot":"","sources":["../../../../src/query-issues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAkB,YAAY,EAAE,MAAM,YAAY,CAAC;AAiB5E;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,SAAO,GAAG,MAAM,CAgB1E;AAYD;;GAEG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,YAAY,CAAC,CA6DvB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAMhE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,WAAW,CA6Bd"}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.3";
1
+ export declare const VERSION = "0.0.4";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniswap/ai-toolkit-linear-task-utils",
3
- "version": "0.0.4",
3
+ "version": "0.0.5-next.0",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "description": "CLI tool to query Linear issues for autonomous Claude Code task processing",