@circuitwall/jarela 2.5.1 → 2.5.2

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 (184) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +5 -5
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/react-loadable-manifest.json +2 -2
  6. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  14. package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  16. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  18. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  19. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js +8 -1
  20. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +8 -1
  22. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js +8 -1
  24. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js +8 -1
  26. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +8 -1
  28. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js +7 -0
  30. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js +7 -0
  32. package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/v1/credentials/route.js +7 -0
  34. package/.next/standalone/.next/server/app/api/v1/credentials/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js +8 -1
  36. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js +7 -0
  38. package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js +7 -0
  40. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js +8 -1
  42. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js +8 -1
  44. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/api/v1/events/route.js +8 -1
  46. package/.next/standalone/.next/server/app/api/v1/events/route.js.nft.json +1 -1
  47. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js +8 -1
  48. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js.nft.json +1 -1
  49. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js +8 -1
  50. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js.nft.json +1 -1
  51. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js +8 -1
  52. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js +8 -1
  54. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/api/v1/extensions/route.js +8 -1
  56. package/.next/standalone/.next/server/app/api/v1/extensions/route.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js +8 -1
  58. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js.nft.json +1 -1
  59. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js +8 -1
  60. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js.nft.json +1 -1
  61. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js +8 -1
  62. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js.nft.json +1 -1
  63. package/.next/standalone/.next/server/app/api/v1/health/probes/route.js +7 -0
  64. package/.next/standalone/.next/server/app/api/v1/health/probes/route.js.nft.json +1 -1
  65. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js +7 -0
  66. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js.nft.json +1 -1
  67. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/callback/route.js +22 -1
  68. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +22 -1
  69. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +22 -1
  70. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +19 -2
  71. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +19 -2
  72. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +19 -2
  73. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js +12 -2
  74. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js.nft.json +1 -1
  75. package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js +7 -0
  76. package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js.nft.json +1 -1
  77. package/.next/standalone/.next/server/app/api/v1/packages/install/route.js +7 -0
  78. package/.next/standalone/.next/server/app/api/v1/packages/install/route.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js +7 -0
  80. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js.nft.json +1 -1
  81. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js +7 -0
  82. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js.nft.json +1 -1
  83. package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js +7 -0
  84. package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js.nft.json +1 -1
  85. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js +12 -2
  86. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js.nft.json +1 -1
  87. package/.next/standalone/.next/server/app/api/v1/packages/route.js +12 -2
  88. package/.next/standalone/.next/server/app/api/v1/packages/route.js.nft.json +1 -1
  89. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js +8 -1
  90. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js.nft.json +1 -1
  91. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +7 -0
  92. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js.nft.json +1 -1
  93. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js +7 -0
  94. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js.nft.json +1 -1
  95. package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js +7 -0
  96. package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js.nft.json +1 -1
  97. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js +8 -1
  98. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/api/v1/system/restart/route.js +7 -0
  100. package/.next/standalone/.next/server/app/api/v1/system/restart/route.js.nft.json +1 -1
  101. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +52 -45
  102. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js.nft.json +1 -1
  103. package/.next/standalone/.next/server/app/api/v1/tools/route.js +8 -1
  104. package/.next/standalone/.next/server/app/api/v1/tools/route.js.nft.json +1 -1
  105. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js.nft.json +1 -1
  106. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js +8 -1
  107. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js.nft.json +1 -1
  108. package/.next/standalone/.next/server/app/api/v1/watchers/route.js +8 -1
  109. package/.next/standalone/.next/server/app/api/v1/watchers/route.js.nft.json +1 -1
  110. package/.next/standalone/.next/server/app/page.js +72982 -72980
  111. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  112. package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  113. package/.next/standalone/.next/server/app-paths-manifest.json +5 -5
  114. package/.next/standalone/.next/server/chunks/1433.js +1 -1
  115. package/.next/standalone/.next/server/chunks/210.js +6 -6
  116. package/.next/standalone/.next/server/chunks/2471.js +17 -17
  117. package/.next/standalone/.next/server/chunks/3524.js +31 -15
  118. package/.next/standalone/.next/server/chunks/3566.js +1 -1
  119. package/.next/standalone/.next/server/chunks/4189.js +1 -1
  120. package/.next/standalone/.next/server/chunks/{9590.js → 423.js} +10 -3
  121. package/.next/standalone/.next/server/chunks/4508.js +2 -2
  122. package/.next/standalone/.next/server/chunks/4596.js +5 -2
  123. package/.next/standalone/.next/server/chunks/46.js +7 -0
  124. package/.next/standalone/.next/server/chunks/540.js +29 -5
  125. package/.next/standalone/.next/server/chunks/5585.js +41 -3
  126. package/.next/standalone/.next/server/chunks/5908.js +10 -10
  127. package/.next/standalone/.next/server/chunks/{3399.js → 6058.js} +882 -400
  128. package/.next/standalone/.next/server/chunks/{9164.js → 6190.js} +13777 -13530
  129. package/.next/standalone/.next/server/chunks/6649.js +1 -1
  130. package/.next/standalone/.next/server/chunks/{1388.js → 8842.js} +5961 -5793
  131. package/.next/standalone/.next/server/chunks/9032.js +5 -5
  132. package/.next/standalone/.next/server/chunks/{7547.js → 9217.js} +485 -3
  133. package/.next/standalone/.next/server/instrumentation.js +7 -0
  134. package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
  135. package/.next/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  136. package/.next/standalone/.next/server/middleware.js +7 -0
  137. package/.next/standalone/.next/server/pages/404.html +1 -1
  138. package/.next/standalone/.next/server/pages/500.html +1 -1
  139. package/.next/standalone/.next/server/preview-props.json +3 -3
  140. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  141. package/.next/standalone/.next/static/chunks/app/{page-dd05bcb5f5b81157.js → page-4112e14360a9909e.js} +1576 -1574
  142. package/.next/standalone/docs/adoption/changesets.json +139 -0
  143. package/.next/standalone/package.json +2 -1
  144. package/CHANGELOG.md +38 -0
  145. package/browser-extension/background.js +5 -539
  146. package/browser-extension/lib/form-editing.mjs +541 -0
  147. package/components/chat/MessageBubble.tsx +4 -736
  148. package/components/chat/MessageContent.tsx +749 -0
  149. package/components/layout/MenuPanel.tsx +1 -1
  150. package/hooks/useSSE.test.ts +46 -0
  151. package/lib/agents/llm.ts +1 -1
  152. package/lib/agents/output-validator/validator.test.ts +4 -0
  153. package/lib/agents/output-validator/validator.ts +1 -1
  154. package/lib/agents/prompt-registry.test.ts +11 -0
  155. package/lib/agents/prompt-registry.ts +13 -0
  156. package/lib/agents/retry-prompts.ts +17 -0
  157. package/lib/agents/run-retry.ts +671 -0
  158. package/lib/agents/run-thread.retry.test.ts +176 -2
  159. package/lib/agents/run-thread.test.ts +6 -6
  160. package/lib/agents/run-thread.ts +9 -717
  161. package/lib/agents/stream-collector.test.ts +28 -4
  162. package/lib/agents/stream-collector.ts +5 -28
  163. package/lib/agents/tool-outcomes.ts +61 -0
  164. package/lib/documents/remote/confluence.test.ts +65 -0
  165. package/lib/documents/remote/confluence.ts +35 -9
  166. package/lib/documents/remote/jira.ts +1 -1
  167. package/lib/health/probes.test.ts +32 -0
  168. package/lib/health/probes.ts +29 -14
  169. package/lib/integrations/atlassian/manifest.ts +5 -3
  170. package/lib/integrations/github/manifest.ts +7 -4
  171. package/lib/integrations/gmail-oauth.ts +16 -1
  172. package/lib/integrations/microsoft-oauth.ts +17 -2
  173. package/lib/integrations/outlook/manifest.ts +10 -8
  174. package/lib/stores/integrations.ts +1 -0
  175. package/lib/tools/communications/calendar-aliases.test.ts +77 -1
  176. package/lib/tools/communications/gmail.test.ts +13 -0
  177. package/lib/tools/communications/ms-graph.test.ts +26 -3
  178. package/lib/tools/communications/ms-graph.ts +9 -11
  179. package/lib/tools/communications/outlook-calendar.ts +94 -17
  180. package/lib/tools/packages/default-packages/atlassian.ts +8 -2
  181. package/package.json +2 -1
  182. package/scripts/standalone-footprint.mjs +1 -1
  183. /package/.next/standalone/.next/static/{XFZTDssHBZKKX2mzH2ld0 → VZXMorlOmSmi3dUr7K5UX}/_buildManifest.js +0 -0
  184. /package/.next/standalone/.next/static/{XFZTDssHBZKKX2mzH2ld0 → VZXMorlOmSmi3dUr7K5UX}/_ssgManifest.js +0 -0
@@ -1381,9 +1381,30 @@ async function getGoogleAccessToken(auth) {
1381
1381
  * @param baseUrl Base for relative `path` (e.g. `https://gmail.googleapis.com/gmail/v1/users/me`).
1382
1382
  * @param path Either a full URL (starts with `http`) or path appended to baseUrl.
1383
1383
  */ async function googleFetch(auth, service, baseUrl, path, init) {
1384
+ let target;
1385
+ try {
1386
+ target = path.startsWith("http") ? new URL(path) : new URL(`${baseUrl}${path}`);
1387
+ } catch {
1388
+ return {
1389
+ error: `${service} request URL is invalid.`
1390
+ };
1391
+ }
1392
+ let base;
1393
+ try {
1394
+ base = new URL(baseUrl);
1395
+ } catch {
1396
+ return {
1397
+ error: `${service} API base URL is invalid.`
1398
+ };
1399
+ }
1400
+ if (target.origin !== base.origin || target.username || target.password) {
1401
+ return {
1402
+ error: `${service} requests must target ${base.hostname}; refusing to forward credentials.`
1403
+ };
1404
+ }
1405
+ const url = target.toString();
1384
1406
  const token = await getGoogleAccessToken(auth);
1385
1407
  if (typeof token !== "string") return token;
1386
- const url = path.startsWith("http") ? path : `${baseUrl}${path}`;
1387
1408
  try {
1388
1409
  const res = await fetch(url, {
1389
1410
  ...init,
@@ -1337,9 +1337,30 @@ async function getGoogleAccessToken(auth) {
1337
1337
  * @param baseUrl Base for relative `path` (e.g. `https://gmail.googleapis.com/gmail/v1/users/me`).
1338
1338
  * @param path Either a full URL (starts with `http`) or path appended to baseUrl.
1339
1339
  */ async function googleFetch(auth, service, baseUrl, path, init) {
1340
+ let target;
1341
+ try {
1342
+ target = path.startsWith("http") ? new URL(path) : new URL(`${baseUrl}${path}`);
1343
+ } catch {
1344
+ return {
1345
+ error: `${service} request URL is invalid.`
1346
+ };
1347
+ }
1348
+ let base;
1349
+ try {
1350
+ base = new URL(baseUrl);
1351
+ } catch {
1352
+ return {
1353
+ error: `${service} API base URL is invalid.`
1354
+ };
1355
+ }
1356
+ if (target.origin !== base.origin || target.username || target.password) {
1357
+ return {
1358
+ error: `${service} requests must target ${base.hostname}; refusing to forward credentials.`
1359
+ };
1360
+ }
1361
+ const url = target.toString();
1340
1362
  const token = await getGoogleAccessToken(auth);
1341
1363
  if (typeof token !== "string") return token;
1342
- const url = path.startsWith("http") ? path : `${baseUrl}${path}`;
1343
1364
  try {
1344
1365
  const res = await fetch(url, {
1345
1366
  ...init,
@@ -1181,9 +1181,30 @@ async function getGoogleAccessToken(auth) {
1181
1181
  * @param baseUrl Base for relative `path` (e.g. `https://gmail.googleapis.com/gmail/v1/users/me`).
1182
1182
  * @param path Either a full URL (starts with `http`) or path appended to baseUrl.
1183
1183
  */ async function googleFetch(auth, service, baseUrl, path, init) {
1184
+ let target;
1185
+ try {
1186
+ target = path.startsWith("http") ? new URL(path) : new URL(`${baseUrl}${path}`);
1187
+ } catch {
1188
+ return {
1189
+ error: `${service} request URL is invalid.`
1190
+ };
1191
+ }
1192
+ let base;
1193
+ try {
1194
+ base = new URL(baseUrl);
1195
+ } catch {
1196
+ return {
1197
+ error: `${service} API base URL is invalid.`
1198
+ };
1199
+ }
1200
+ if (target.origin !== base.origin || target.username || target.password) {
1201
+ return {
1202
+ error: `${service} requests must target ${base.hostname}; refusing to forward credentials.`
1203
+ };
1204
+ }
1205
+ const url = target.toString();
1184
1206
  const token = await getGoogleAccessToken(auth);
1185
1207
  if (typeof token !== "string") return token;
1186
- const url = path.startsWith("http") ? path : `${baseUrl}${path}`;
1187
1208
  try {
1188
1209
  const res = await fetch(url, {
1189
1210
  ...init,
@@ -1054,6 +1054,8 @@ const TENANT = process.env.OUTLOOK_TENANT?.trim() || "common";
1054
1054
  // - Mail.ReadWrite → search/read mail, create drafts, mark read,
1055
1055
  // move to folders (incl. DeletedItems).
1056
1056
  // - Mail.Send → send mail when the user explicitly asks for it.
1057
+ // - Files.Read.All → Microsoft Search over OneDrive/SharePoint files.
1058
+ // - Sites.Read.All → Microsoft Search over SharePoint lists and sites.
1057
1059
  // - Calendars.ReadWrite → list/get/create/update/delete events on the
1058
1060
  // user's existing calendars.
1059
1061
  // - Tasks.ReadWrite → list/get/create/update/complete/delete Microsoft
@@ -1065,6 +1067,8 @@ const MICROSOFT_SCOPES = [
1065
1067
  "User.Read",
1066
1068
  "Mail.ReadWrite",
1067
1069
  "Mail.Send",
1070
+ "Files.Read.All",
1071
+ "Sites.Read.All",
1068
1072
  "Calendars.ReadWrite",
1069
1073
  "Tasks.ReadWrite",
1070
1074
  "People.Read"
@@ -1240,7 +1244,7 @@ const SCOPE_HINTS = [
1240
1244
  },
1241
1245
  {
1242
1246
  prefix: "/search/query",
1243
- scope: "Mail.Read Files.Read.All"
1247
+ scope: "Mail.Read / Calendars.Read for mail and events; Files.Read.All for files; Sites.Read.All for lists and sites"
1244
1248
  },
1245
1249
  {
1246
1250
  prefix: "/me",
@@ -1278,7 +1282,20 @@ function backoffFor(attempt) {
1278
1282
  // - 403 Forbidden → surface a scope hint ("reconnect with X") so the
1279
1283
  // operator knows what to grant.
1280
1284
  async function graphFetch(auth, path, init) {
1281
- const url = path.startsWith("http") ? path : `https://graph.microsoft.com/v1.0${path}`;
1285
+ let target;
1286
+ try {
1287
+ target = path.startsWith("http") ? new URL(path) : new URL(`https://graph.microsoft.com/v1.0${path}`);
1288
+ } catch {
1289
+ return {
1290
+ error: "Microsoft Graph request URL is invalid."
1291
+ };
1292
+ }
1293
+ if (target.origin !== "https://graph.microsoft.com" || target.username || target.password) {
1294
+ return {
1295
+ error: "Microsoft Graph requests must target graph.microsoft.com; refusing to forward credentials."
1296
+ };
1297
+ }
1298
+ const url = target.toString();
1282
1299
  let attempt = 0;
1283
1300
  let triedReauth = false;
1284
1301
  while(true){
@@ -1021,6 +1021,8 @@ const TENANT = process.env.OUTLOOK_TENANT?.trim() || "common";
1021
1021
  // - Mail.ReadWrite → search/read mail, create drafts, mark read,
1022
1022
  // move to folders (incl. DeletedItems).
1023
1023
  // - Mail.Send → send mail when the user explicitly asks for it.
1024
+ // - Files.Read.All → Microsoft Search over OneDrive/SharePoint files.
1025
+ // - Sites.Read.All → Microsoft Search over SharePoint lists and sites.
1024
1026
  // - Calendars.ReadWrite → list/get/create/update/delete events on the
1025
1027
  // user's existing calendars.
1026
1028
  // - Tasks.ReadWrite → list/get/create/update/complete/delete Microsoft
@@ -1032,6 +1034,8 @@ const MICROSOFT_SCOPES = [
1032
1034
  "User.Read",
1033
1035
  "Mail.ReadWrite",
1034
1036
  "Mail.Send",
1037
+ "Files.Read.All",
1038
+ "Sites.Read.All",
1035
1039
  "Calendars.ReadWrite",
1036
1040
  "Tasks.ReadWrite",
1037
1041
  "People.Read"
@@ -1207,7 +1211,7 @@ const SCOPE_HINTS = [
1207
1211
  },
1208
1212
  {
1209
1213
  prefix: "/search/query",
1210
- scope: "Mail.Read Files.Read.All"
1214
+ scope: "Mail.Read / Calendars.Read for mail and events; Files.Read.All for files; Sites.Read.All for lists and sites"
1211
1215
  },
1212
1216
  {
1213
1217
  prefix: "/me",
@@ -1245,7 +1249,20 @@ function backoffFor(attempt) {
1245
1249
  // - 403 Forbidden → surface a scope hint ("reconnect with X") so the
1246
1250
  // operator knows what to grant.
1247
1251
  async function graphFetch(auth, path, init) {
1248
- const url = path.startsWith("http") ? path : `https://graph.microsoft.com/v1.0${path}`;
1252
+ let target;
1253
+ try {
1254
+ target = path.startsWith("http") ? new URL(path) : new URL(`https://graph.microsoft.com/v1.0${path}`);
1255
+ } catch {
1256
+ return {
1257
+ error: "Microsoft Graph request URL is invalid."
1258
+ };
1259
+ }
1260
+ if (target.origin !== "https://graph.microsoft.com" || target.username || target.password) {
1261
+ return {
1262
+ error: "Microsoft Graph requests must target graph.microsoft.com; refusing to forward credentials."
1263
+ };
1264
+ }
1265
+ const url = target.toString();
1249
1266
  let attempt = 0;
1250
1267
  let triedReauth = false;
1251
1268
  while(true){
@@ -917,6 +917,8 @@ const TENANT = process.env.OUTLOOK_TENANT?.trim() || "common";
917
917
  // - Mail.ReadWrite → search/read mail, create drafts, mark read,
918
918
  // move to folders (incl. DeletedItems).
919
919
  // - Mail.Send → send mail when the user explicitly asks for it.
920
+ // - Files.Read.All → Microsoft Search over OneDrive/SharePoint files.
921
+ // - Sites.Read.All → Microsoft Search over SharePoint lists and sites.
920
922
  // - Calendars.ReadWrite → list/get/create/update/delete events on the
921
923
  // user's existing calendars.
922
924
  // - Tasks.ReadWrite → list/get/create/update/complete/delete Microsoft
@@ -928,6 +930,8 @@ const MICROSOFT_SCOPES = [
928
930
  "User.Read",
929
931
  "Mail.ReadWrite",
930
932
  "Mail.Send",
933
+ "Files.Read.All",
934
+ "Sites.Read.All",
931
935
  "Calendars.ReadWrite",
932
936
  "Tasks.ReadWrite",
933
937
  "People.Read"
@@ -1103,7 +1107,7 @@ const SCOPE_HINTS = [
1103
1107
  },
1104
1108
  {
1105
1109
  prefix: "/search/query",
1106
- scope: "Mail.Read Files.Read.All"
1110
+ scope: "Mail.Read / Calendars.Read for mail and events; Files.Read.All for files; Sites.Read.All for lists and sites"
1107
1111
  },
1108
1112
  {
1109
1113
  prefix: "/me",
@@ -1141,7 +1145,20 @@ function backoffFor(attempt) {
1141
1145
  // - 403 Forbidden → surface a scope hint ("reconnect with X") so the
1142
1146
  // operator knows what to grant.
1143
1147
  async function graphFetch(auth, path, init) {
1144
- const url = path.startsWith("http") ? path : `https://graph.microsoft.com/v1.0${path}`;
1148
+ let target;
1149
+ try {
1150
+ target = path.startsWith("http") ? new URL(path) : new URL(`https://graph.microsoft.com/v1.0${path}`);
1151
+ } catch {
1152
+ return {
1153
+ error: "Microsoft Graph request URL is invalid."
1154
+ };
1155
+ }
1156
+ if (target.origin !== "https://graph.microsoft.com" || target.username || target.password) {
1157
+ return {
1158
+ error: "Microsoft Graph requests must target graph.microsoft.com; refusing to forward credentials."
1159
+ };
1160
+ }
1161
+ const url = target.toString();
1145
1162
  let attempt = 0;
1146
1163
  let triedReauth = false;
1147
1164
  while(true){
@@ -327,6 +327,13 @@ module.exports = require("node:util");
327
327
 
328
328
  /***/ }),
329
329
 
330
+ /***/ 58500:
331
+ /***/ ((module) => {
332
+
333
+ module.exports = require("node:timers/promises");
334
+
335
+ /***/ }),
336
+
330
337
  /***/ 63033:
331
338
  /***/ ((module) => {
332
339
 
@@ -1468,9 +1475,12 @@ const atlassianDefaultPackage = {
1468
1475
  mapStoreFields: (raw)=>raw.url && raw.email && raw.api_token ? {
1469
1476
  url: raw.url.replace(/\/+$/, ""),
1470
1477
  email: raw.email,
1471
- apiToken: raw.api_token
1478
+ apiToken: raw.api_token,
1479
+ ...raw.cloud_id ? {
1480
+ cloudId: raw.cloud_id
1481
+ } : {}
1472
1482
  } : null,
1473
- notConfiguredError: "Atlassian not configured. Open Settings → Credentials and add your Atlassian site URL, " + "email, and API token. (Or set ATLASSIAN_URL / ATLASSIAN_EMAIL / ATLASSIAN_API_TOKEN env vars.)"
1483
+ notConfiguredError: "Atlassian not configured. Open Settings → Credentials and add your Atlassian site URL, " + "email, and API token. Scoped API tokens also need the Cloud ID. " + "(Or set ATLASSIAN_URL / ATLASSIAN_EMAIL / ATLASSIAN_API_TOKEN and optional ATLASSIAN_CLOUD_ID env vars.)"
1474
1484
  }
1475
1485
  })
1476
1486
  };