@sideboard-ai/core 0.1.323 → 0.1.325

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 (83) hide show
  1. package/dist/{abletime-5ZY3ZUUO.js → abletime-M7STTMZT.js} +6 -5
  2. package/dist/{abletime-CU2UPMJF.js → abletime-VL234MCP.js} +5 -4
  3. package/dist/{abletime-oauth-7EOSBEFM.js → abletime-oauth-LMMGMAPA.js} +3 -3
  4. package/dist/{abletime-oauth-4TTCR3CT.js → abletime-oauth-P4ZFBEAL.js} +3 -3
  5. package/dist/{abletime-rest-3TG4G7LW.js → abletime-rest-DLV7EIWS.js} +3 -3
  6. package/dist/{abletime-rest-KOKE7V4B.js → abletime-rest-GOI7HELR.js} +3 -3
  7. package/dist/agents/claude-runner.cjs +59 -22
  8. package/dist/agents/claude-runner.js +39 -16
  9. package/dist/agents/cursor-runner.cjs +96 -31
  10. package/dist/agents/cursor-runner.js +74 -24
  11. package/dist/{agents-2ZXORBEJ.js → agents-LDRM3BTY.js} +9 -8
  12. package/dist/{agents-SPRAOMGI.js → agents-MBIEAETM.js} +12 -11
  13. package/dist/{app-settings-I5HM5RMP.js → app-settings-E7DMMEKC.js} +1 -1
  14. package/dist/{app-settings-XIF4EC4K.js → app-settings-UQHUNOLV.js} +1 -1
  15. package/dist/{chunk-INBUV7HY.js → chunk-2UP3XD2D.js} +2 -2
  16. package/dist/{chunk-EQ52JR3Q.js → chunk-5MXLDDYF.js} +1 -1
  17. package/dist/{chunk-NCHOTN3C.js → chunk-5YCKATG6.js} +4 -3
  18. package/dist/{chunk-SKO7IGKU.js → chunk-7G27TB4M.js} +6 -6
  19. package/dist/chunk-7LUOLYFM.js +1445 -0
  20. package/dist/{chunk-Y3WREIPQ.js → chunk-A76MKMSF.js} +12 -210
  21. package/dist/{chunk-6W3XRKD5.js → chunk-APKUI4BP.js} +6 -7
  22. package/dist/{chunk-FR3SAYUL.js → chunk-AQEKPJWU.js} +5 -5
  23. package/dist/{chunk-QOS4465Y.js → chunk-BOFYI6LC.js} +1 -1
  24. package/dist/{chunk-FUFNMUNR.js → chunk-BTF3ATST.js} +7 -8
  25. package/dist/{chunk-OIHRC2ZJ.js → chunk-CI4M54LS.js} +22 -2
  26. package/dist/chunk-DBKHL7NC.js +214 -0
  27. package/dist/{chunk-ROOZDDFA.js → chunk-EO6ZFLG6.js} +7 -8
  28. package/dist/chunk-EZR6W4B3.js +1259 -0
  29. package/dist/{chunk-MZIZTSR2.js → chunk-F65JMKUR.js} +2 -2
  30. package/dist/chunk-F6GE7V3Q.js +216 -0
  31. package/dist/{chunk-4C5PQ7JA.js → chunk-GNLKBS3U.js} +206 -188
  32. package/dist/{chunk-EKU7FQVG.js → chunk-H36GKGU2.js} +2 -2
  33. package/dist/{chunk-53SBTCKF.js → chunk-HG6KS7OT.js} +294 -265
  34. package/dist/chunk-MBT6WDAB.js +28 -0
  35. package/dist/{chunk-D3VSKNVA.js → chunk-MFMDZAA6.js} +262 -233
  36. package/dist/{chunk-7PVT73H6.js → chunk-NWGINMEA.js} +12 -210
  37. package/dist/{chunk-QIC2JXHW.js → chunk-OOXRMTU6.js} +1 -1
  38. package/dist/{chunk-5XNT6BCG.js → chunk-OPXEJJBM.js} +1 -1
  39. package/dist/chunk-OYRN356W.js +80 -0
  40. package/dist/chunk-PPTJMBUY.js +25 -0
  41. package/dist/{chunk-B4CDSSRN.js → chunk-Q3FHTGIW.js} +2 -0
  42. package/dist/{chunk-EJ66LEKH.js → chunk-RZJTGBXY.js} +22 -2
  43. package/dist/{chunk-JDX3474T.js → chunk-SACHHTBJ.js} +207 -186
  44. package/dist/{chunk-5GDJSFCT.js → chunk-SK6NYGPD.js} +2 -2
  45. package/dist/{chunk-74OPNF7U.js → chunk-SQQBU7Z6.js} +2 -2
  46. package/dist/{chunk-Q3YJZPQI.js → chunk-SS6CYGLF.js} +3 -3
  47. package/dist/{chunk-YDUHLWI5.js → chunk-SUZOPJZC.js} +21 -7
  48. package/dist/{chunk-ZHGMRBSC.js → chunk-U5WO6MEB.js} +3 -3
  49. package/dist/{chunk-NXUN4U5P.js → chunk-VAFQS4D2.js} +2 -2
  50. package/dist/chunk-W3ZLE4PO.js +77 -0
  51. package/dist/{chunk-RTVS3M74.js → chunk-WYEST76H.js} +7 -7
  52. package/dist/{chunk-ODH3XHMI.js → chunk-ZEUMWHOH.js} +5 -5
  53. package/dist/{chunk-MYVKOIIY.js → chunk-ZHDXLDLA.js} +6 -7
  54. package/dist/{chunk-IFWGG2M2.js → chunk-ZSHS46V5.js} +2 -0
  55. package/dist/{conductor-52KTQ3IM.js → conductor-D4KFZF54.js} +6 -6
  56. package/dist/{conductor-FB7MKLRN.js → conductor-KB7L7NQN.js} +7 -7
  57. package/dist/{coordinator-prompt-7HXV7HJ5.js → coordinator-prompt-OBXEC63K.js} +4 -4
  58. package/dist/{coordinator-prompt-7W7WPY4X.js → coordinator-prompt-SUO4FRY3.js} +4 -4
  59. package/dist/{cursor-recover-TEBFKAZ4.js → cursor-recover-7F46PAJ5.js} +1 -1
  60. package/dist/{cursor-recover-OWPQUHFH.js → cursor-recover-BDIAZIE3.js} +1 -1
  61. package/dist/{global-workspace-EI3KBGZE.js → global-workspace-UHU2FXTY.js} +4 -4
  62. package/dist/{global-workspace-5BWUTSPJ.js → global-workspace-Z2SURNHA.js} +4 -4
  63. package/dist/index.cjs +21115 -20868
  64. package/dist/index.d.cts +28 -12
  65. package/dist/index.d.ts +28 -12
  66. package/dist/index.js +343 -1678
  67. package/dist/linear-HFUOUJ5H.js +67 -0
  68. package/dist/linear-SIHEBU3X.js +69 -0
  69. package/dist/linear-list-63I7QUC6.js +6 -0
  70. package/dist/linear-list-JFV3EES6.js +8 -0
  71. package/dist/mcp/run-stdio.cjs +15909 -15654
  72. package/dist/mcp/run-stdio.js +67 -1247
  73. package/dist/{optional-cli-RMMS5L6F.js → optional-cli-U2GUA2X6.js} +3 -3
  74. package/dist/{optional-cli-Y3Z3GIPZ.js → optional-cli-ULDP3O5S.js} +4 -4
  75. package/dist/{orchestrator-RMPZETOO.js → orchestrator-3H4KNGPN.js} +15 -13
  76. package/dist/{orchestrator-2RDE2YS3.js → orchestrator-6ROMEWBP.js} +14 -12
  77. package/dist/{thread-store-3F7GR64A.js → thread-store-4ZN3DS2W.js} +1 -1
  78. package/dist/{thread-store-JRSL4HQY.js → thread-store-IC4BQXDW.js} +1 -1
  79. package/dist/{workspaces-LJQS73K6.js → workspaces-MG5JHRKW.js} +4 -4
  80. package/dist/{workspaces-OPQ5NMM6.js → workspaces-QJNKEGEM.js} +4 -4
  81. package/dist/{worktree-ZDA2UJ7C.js → worktree-KSJPTHGZ.js} +3 -3
  82. package/dist/{worktree-4NGXCCUO.js → worktree-MYJYUHZM.js} +3 -3
  83. package/package.json +1 -1
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-YBTSZ2SW.js";
10
10
  import {
11
11
  resolveAgentExecutable
12
- } from "./chunk-OIHRC2ZJ.js";
12
+ } from "./chunk-CI4M54LS.js";
13
13
 
14
14
  // src/agents/install.ts
15
15
  import { existsSync } from "fs";
@@ -267,7 +267,7 @@ async function loginAgent(agent) {
267
267
  };
268
268
  }
269
269
  async function loginManagedAccount(accountId) {
270
- const { loadAppSettings } = await import("./app-settings-I5HM5RMP.js");
270
+ const { loadAppSettings } = await import("./app-settings-E7DMMEKC.js");
271
271
  const { loginEnvPrefix } = await import("./managed-accounts-PITLFLKU.js");
272
272
  const account = loadAppSettings().accounts.accounts.find((a) => a.id === accountId);
273
273
  if (!account) {
@@ -0,0 +1,216 @@
1
+ #!/usr/bin/env node
2
+
3
+ import {
4
+ ATTACHMENTS_DIR,
5
+ attachmentsGitignoreBody
6
+ } from "./chunk-N2WW62LF.js";
7
+ import {
8
+ httpFetch
9
+ } from "./chunk-2GPQZZLY.js";
10
+
11
+ // src/integrations/issue-attachments.ts
12
+ import { existsSync, mkdirSync, writeFileSync } from "fs";
13
+ import { basename, extname, join } from "path";
14
+ import { randomUUID } from "crypto";
15
+ var ISSUE_ATTACHMENT_MAX_BYTES = 25 * 1024 * 1024;
16
+ var MARKDOWN_IMAGE_RE = /!\[[^\]]*]\(\s*<?(https?:\/\/[^)\s>]+)>?/gi;
17
+ var MARKDOWN_LINK_RE = /(?<!!)\[[^\]]*]\(\s*<?(https?:\/\/[^)\s>]+)>?/gi;
18
+ var HTML_SRC_RE = /\b(?:src|href)\s*=\s*["'](https?:\/\/[^"']+)["']/gi;
19
+ var BARE_URL_RE = /https?:\/\/[^\s<>"'`)]+/gi;
20
+ var EXT_BY_MIME = {
21
+ "image/png": ".png",
22
+ "image/jpeg": ".jpg",
23
+ "image/jpg": ".jpg",
24
+ "image/gif": ".gif",
25
+ "image/webp": ".webp",
26
+ "image/svg+xml": ".svg",
27
+ "application/pdf": ".pdf",
28
+ "text/plain": ".txt",
29
+ "text/markdown": ".md",
30
+ "application/json": ".json",
31
+ "application/zip": ".zip"
32
+ };
33
+ function issueAttachmentWorktreePath(repoPath) {
34
+ const raw = (repoPath ?? "").trim();
35
+ return raw || process.cwd();
36
+ }
37
+ function ensureIssueAttachmentsDir(worktreePath) {
38
+ const dir = join(worktreePath, ATTACHMENTS_DIR);
39
+ mkdirSync(dir, { recursive: true });
40
+ const gi = join(dir, ".gitignore");
41
+ if (!existsSync(gi)) {
42
+ writeFileSync(gi, attachmentsGitignoreBody(), "utf8");
43
+ }
44
+ return dir;
45
+ }
46
+ function hostnameOf(url) {
47
+ try {
48
+ return new URL(url).hostname.toLowerCase();
49
+ } catch {
50
+ return "";
51
+ }
52
+ }
53
+ function hostMatches(url, suffixes) {
54
+ const host = hostnameOf(url);
55
+ if (!host) return false;
56
+ return suffixes.some((suffix) => host === suffix || host.endsWith(`.${suffix}`));
57
+ }
58
+ function looksLikeHttpUrl(value) {
59
+ return /^https?:\/\//i.test(value.trim());
60
+ }
61
+ function looksLikeFileUrl(url) {
62
+ try {
63
+ const path = new URL(url).pathname;
64
+ return /\.[a-z0-9]{2,8}$/i.test(path);
65
+ } catch {
66
+ return false;
67
+ }
68
+ }
69
+ function filenameFromUrl(url, fallback = "attachment") {
70
+ try {
71
+ const parsed = new URL(url);
72
+ const last = decodeURIComponent(basename(parsed.pathname)).replace(/[/\\]/g, "_");
73
+ if (last && last !== "/" && last !== ".") return last;
74
+ } catch {
75
+ }
76
+ return fallback;
77
+ }
78
+ function filenameFromContentDisposition(header) {
79
+ if (!header) return void 0;
80
+ const star = header.match(/filename\*\s*=\s*(?:UTF-8''|utf-8'')([^;]+)/i);
81
+ if (star?.[1]) {
82
+ try {
83
+ return decodeURIComponent(star[1].trim().replace(/^["']|["']$/g, ""));
84
+ } catch {
85
+ return star[1].trim().replace(/^["']|["']$/g, "");
86
+ }
87
+ }
88
+ const plain = header.match(/filename\s*=\s*("(?:\\.|[^"])*"|[^;]+)/i);
89
+ if (!plain?.[1]) return void 0;
90
+ return plain[1].trim().replace(/^["']|["']$/g, "").replace(/\\"/g, '"');
91
+ }
92
+ function uniqueAttachmentFileName(dir, originalName) {
93
+ const safe = originalName.replace(/[/\\]/g, "_").replace(/^\.+/, "") || "file";
94
+ if (!existsSync(join(dir, safe))) return safe;
95
+ const ext = extname(safe);
96
+ const stem = ext ? safe.slice(0, -ext.length) : safe;
97
+ for (let i = 1; i < 1e4; i++) {
98
+ const candidate = `${stem}-${i}${ext}`;
99
+ if (!existsSync(join(dir, candidate))) return candidate;
100
+ }
101
+ return `${stem}-${randomUUID()}${ext}`;
102
+ }
103
+ function extractHttpUrls(markdown) {
104
+ const text = markdown ?? "";
105
+ if (!text.trim()) return [];
106
+ const found = [];
107
+ const seen = /* @__PURE__ */ new Set();
108
+ const push = (raw) => {
109
+ const url = raw.replace(/[).,;]+$/, "");
110
+ if (!looksLikeHttpUrl(url) || seen.has(url)) return;
111
+ seen.add(url);
112
+ found.push(url);
113
+ };
114
+ for (const re of [MARKDOWN_IMAGE_RE, MARKDOWN_LINK_RE, HTML_SRC_RE, BARE_URL_RE]) {
115
+ re.lastIndex = 0;
116
+ let match;
117
+ while (match = re.exec(text)) {
118
+ if (match[1]) push(match[1]);
119
+ else if (re === BARE_URL_RE) push(match[0]);
120
+ }
121
+ }
122
+ return found;
123
+ }
124
+ function mergeIssueAttachments(items) {
125
+ const out = [];
126
+ const seen = /* @__PURE__ */ new Set();
127
+ for (const item of items) {
128
+ if (!item) continue;
129
+ const url = item.url.trim();
130
+ const id = item.id.trim() || url;
131
+ if (!id && !url) continue;
132
+ const key = url || id;
133
+ if (seen.has(key) || seen.has(id)) continue;
134
+ seen.add(key);
135
+ if (id !== key) seen.add(id);
136
+ out.push({
137
+ id: id || url,
138
+ name: item.name.trim() || filenameFromUrl(url),
139
+ url,
140
+ ...item.contentType ? { contentType: item.contentType } : {},
141
+ ...item.sourceType ? { sourceType: item.sourceType } : {}
142
+ });
143
+ }
144
+ return out;
145
+ }
146
+ function extensionForContentType(contentType, name) {
147
+ if (extname(name)) return name;
148
+ const mime = (contentType ?? "").split(";")[0]?.trim().toLowerCase() ?? "";
149
+ const ext = EXT_BY_MIME[mime];
150
+ return ext ? `${name}${ext}` : name;
151
+ }
152
+ function assertNotHtml(contentType, url) {
153
+ const mime = (contentType ?? "").split(";")[0]?.trim().toLowerCase() ?? "";
154
+ if (mime === "text/html" || mime === "application/xhtml+xml") {
155
+ throw new Error(
156
+ `Attachment at ${url} returned HTML, not a file. Use the listed file URL (uploads / user-attachments), not a ticket or PR page.`
157
+ );
158
+ }
159
+ }
160
+ async function downloadAuthenticatedFile(opts) {
161
+ const url = opts.url.trim();
162
+ if (!looksLikeHttpUrl(url)) {
163
+ throw new Error(`Attachment URL must be http(s) (got ${url || "empty"})`);
164
+ }
165
+ const res = await httpFetch(url, {
166
+ method: "GET",
167
+ redirect: "follow",
168
+ headers: {
169
+ Accept: "*/*",
170
+ ...opts.headers ?? {}
171
+ }
172
+ });
173
+ if (!res.ok) {
174
+ const detail = await res.text().catch(() => "");
175
+ throw new Error(
176
+ `Attachment download failed ${res.status}${detail ? `: ${detail.slice(0, 200)}` : ""} (${url})`
177
+ );
178
+ }
179
+ const contentType = res.headers.get("content-type") ?? void 0;
180
+ assertNotHtml(contentType, url);
181
+ const lengthHeader = res.headers.get("content-length");
182
+ if (lengthHeader) {
183
+ const length = Number(lengthHeader);
184
+ if (Number.isFinite(length) && length > ISSUE_ATTACHMENT_MAX_BYTES) {
185
+ throw new Error(
186
+ `Attachment is ${length} bytes; max is ${ISSUE_ATTACHMENT_MAX_BYTES} (${url})`
187
+ );
188
+ }
189
+ }
190
+ const buf = Buffer.from(await res.arrayBuffer());
191
+ if (buf.length > ISSUE_ATTACHMENT_MAX_BYTES) {
192
+ throw new Error(
193
+ `Attachment is ${buf.length} bytes; max is ${ISSUE_ATTACHMENT_MAX_BYTES} (${url})`
194
+ );
195
+ }
196
+ const dir = ensureIssueAttachmentsDir(opts.worktreePath);
197
+ const hinted = opts.name?.trim() || filenameFromContentDisposition(res.headers.get("content-disposition")) || filenameFromUrl(url);
198
+ const name = uniqueAttachmentFileName(dir, extensionForContentType(contentType, hinted));
199
+ writeFileSync(join(dir, name), buf);
200
+ return {
201
+ name,
202
+ path: `${ATTACHMENTS_DIR}/${name}`,
203
+ bytes: buf.length,
204
+ ...contentType ? { contentType } : {}
205
+ };
206
+ }
207
+
208
+ export {
209
+ issueAttachmentWorktreePath,
210
+ hostMatches,
211
+ looksLikeHttpUrl,
212
+ looksLikeFileUrl,
213
+ extractHttpUrls,
214
+ mergeIssueAttachments,
215
+ downloadAuthenticatedFile
216
+ };