@circuitwall/jarela 2.5.0 → 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 (188) 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 +2 -2
  14. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  15. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  16. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  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 +2 -2
  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 +73385 -73375
  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/3524.js +31 -15
  117. package/.next/standalone/.next/server/chunks/3566.js +1 -1
  118. package/.next/standalone/.next/server/chunks/4189.js +1 -1
  119. package/.next/standalone/.next/server/chunks/{9590.js → 423.js} +10 -3
  120. package/.next/standalone/.next/server/chunks/4596.js +5 -2
  121. package/.next/standalone/.next/server/chunks/46.js +7 -0
  122. package/.next/standalone/.next/server/chunks/540.js +29 -5
  123. package/.next/standalone/.next/server/chunks/5585.js +41 -3
  124. package/.next/standalone/.next/server/chunks/5908.js +10 -10
  125. package/.next/standalone/.next/server/chunks/{3399.js → 6058.js} +485 -3
  126. package/.next/standalone/.next/server/chunks/{9164.js → 6190.js} +13828 -13581
  127. package/.next/standalone/.next/server/chunks/{1388.js → 8842.js} +5961 -5793
  128. package/.next/standalone/.next/server/chunks/9032.js +5 -5
  129. package/.next/standalone/.next/server/chunks/{7547.js → 9217.js} +485 -3
  130. package/.next/standalone/.next/server/instrumentation.js +7 -0
  131. package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
  132. package/.next/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  133. package/.next/standalone/.next/server/middleware.js +7 -0
  134. package/.next/standalone/.next/server/pages/404.html +2 -2
  135. package/.next/standalone/.next/server/pages/500.html +1 -1
  136. package/.next/standalone/.next/server/preview-props.json +3 -3
  137. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  138. package/.next/standalone/.next/static/chunks/app/{page-2ef8d75d40eb4311.js → page-4112e14360a9909e.js} +1291 -1281
  139. package/.next/standalone/.next/static/css/{c160ea862133acd2.css → 5b30046ba49144c5.css} +2 -2
  140. package/.next/standalone/docs/adoption/changesets.json +151 -0
  141. package/.next/standalone/package.json +2 -1
  142. package/CHANGELOG.md +46 -0
  143. package/browser-extension/background.js +5 -539
  144. package/browser-extension/lib/form-editing.mjs +541 -0
  145. package/components/chat/MessageBubble.tsx +4 -736
  146. package/components/chat/MessageContent.tsx +749 -0
  147. package/components/dashboard/DashboardPanel.test.tsx +34 -0
  148. package/components/dashboard/DashboardPanel.tsx +1 -1
  149. package/components/layout/MenuPanel.tsx +1 -1
  150. package/components/ui/BootScreen.test.tsx +1 -0
  151. package/components/ui/BootScreen.tsx +1 -0
  152. package/components/ui/ServerStatus.test.tsx +50 -0
  153. package/components/ui/ServerStatus.tsx +10 -8
  154. package/hooks/useSSE.test.ts +46 -0
  155. package/lib/agents/llm.ts +1 -1
  156. package/lib/agents/output-validator/validator.test.ts +4 -0
  157. package/lib/agents/output-validator/validator.ts +1 -1
  158. package/lib/agents/prompt-registry.test.ts +11 -0
  159. package/lib/agents/prompt-registry.ts +13 -0
  160. package/lib/agents/retry-prompts.ts +17 -0
  161. package/lib/agents/run-retry.ts +671 -0
  162. package/lib/agents/run-thread.retry.test.ts +176 -2
  163. package/lib/agents/run-thread.test.ts +6 -6
  164. package/lib/agents/run-thread.ts +9 -717
  165. package/lib/agents/stream-collector.test.ts +28 -4
  166. package/lib/agents/stream-collector.ts +5 -28
  167. package/lib/agents/tool-outcomes.ts +61 -0
  168. package/lib/documents/remote/confluence.test.ts +65 -0
  169. package/lib/documents/remote/confluence.ts +35 -9
  170. package/lib/documents/remote/jira.ts +1 -1
  171. package/lib/health/probes.test.ts +32 -0
  172. package/lib/health/probes.ts +29 -14
  173. package/lib/integrations/atlassian/manifest.ts +5 -3
  174. package/lib/integrations/github/manifest.ts +7 -4
  175. package/lib/integrations/gmail-oauth.ts +16 -1
  176. package/lib/integrations/microsoft-oauth.ts +17 -2
  177. package/lib/integrations/outlook/manifest.ts +10 -8
  178. package/lib/stores/integrations.ts +1 -0
  179. package/lib/tools/communications/calendar-aliases.test.ts +77 -1
  180. package/lib/tools/communications/gmail.test.ts +13 -0
  181. package/lib/tools/communications/ms-graph.test.ts +26 -3
  182. package/lib/tools/communications/ms-graph.ts +9 -11
  183. package/lib/tools/communications/outlook-calendar.ts +94 -17
  184. package/lib/tools/packages/default-packages/atlassian.ts +8 -2
  185. package/package.json +2 -1
  186. package/scripts/standalone-footprint.mjs +1 -1
  187. /package/.next/standalone/.next/static/{544OFJV-q0RC6Gjgje4LT → VZXMorlOmSmi3dUr7K5UX}/_buildManifest.js +0 -0
  188. /package/.next/standalone/.next/static/{544OFJV-q0RC6Gjgje4LT → VZXMorlOmSmi3dUr7K5UX}/_ssgManifest.js +0 -0
@@ -1177,9 +1177,12 @@ const atlassianDefaultPackage = {
1177
1177
  mapStoreFields: (raw)=>raw.url && raw.email && raw.api_token ? {
1178
1178
  url: raw.url.replace(/\/+$/, ""),
1179
1179
  email: raw.email,
1180
- apiToken: raw.api_token
1180
+ apiToken: raw.api_token,
1181
+ ...raw.cloud_id ? {
1182
+ cloudId: raw.cloud_id
1183
+ } : {}
1181
1184
  } : null,
1182
- 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.)"
1185
+ 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.)"
1183
1186
  }
1184
1187
  })
1185
1188
  };
@@ -9357,6 +9357,13 @@ const INTEGRATIONS = {
9357
9357
  secret: false,
9358
9358
  required: true
9359
9359
  },
9360
+ {
9361
+ key: "cloud_id",
9362
+ label: "Cloud ID (scoped API tokens only)",
9363
+ placeholder: "UUID from your Atlassian cloudId",
9364
+ secret: false,
9365
+ required: false
9366
+ },
9360
9367
  {
9361
9368
  key: "email",
9362
9369
  label: "Account email",
@@ -227,16 +227,32 @@ async function runConfluenceIndexer(source) {
227
227
  const auth = (0,auth_registry/* resolvePackageAuth */.pR)("atlassian");
228
228
  if ("error" in auth) throw new Error(auth.error);
229
229
  const cql = buildCql(source, source.last_cursor);
230
- let start = 0;
230
+ let cursor;
231
+ const seenCursors = new Set();
231
232
  let highWater = source.last_cursor;
232
233
  while(stats.scanned < MAX_PAGES_PER_RUN){
233
- const url = `/wiki/rest/api/content/search?cql=${encodeURIComponent(cql)}` + `&expand=body.storage,version,history.lastUpdated&limit=${PAGE_LIMIT}&start=${start}`;
234
+ if (cursor) {
235
+ if (seenCursors.has(cursor)) break;
236
+ seenCursors.add(cursor);
237
+ }
238
+ const params = new URLSearchParams({
239
+ cql,
240
+ expand: "content.body.storage,content.version,content.history.lastUpdated",
241
+ limit: String(PAGE_LIMIT)
242
+ });
243
+ if (cursor) params.set("cursor", cursor);
244
+ const url = `/wiki/rest/api/search?${params}`;
234
245
  const data = await atlassianFetch(auth, url);
235
246
  if (data.error) throw new Error(data.error);
236
247
  const results = data.results ?? [];
237
248
  if (results.length === 0) break;
238
- for (const page of results){
249
+ for (const result of results){
239
250
  stats.scanned++;
251
+ const page = result.content;
252
+ if (!page?.id || !page.title) {
253
+ stats.errors++;
254
+ continue;
255
+ }
240
256
  try {
241
257
  const text = `${page.title}\n\n${htmlToText(page.body?.storage?.value ?? "")}`.trim();
242
258
  const updatedAt = pageUpdatedAt(page);
@@ -256,8 +272,16 @@ async function runConfluenceIndexer(source) {
256
272
  stats.errors++;
257
273
  }
258
274
  }
259
- start += results.length;
260
- if (results.length < PAGE_LIMIT) break;
275
+ const next = data._links?.next;
276
+ if (!next) break;
277
+ let nextCursor = null;
278
+ try {
279
+ nextCursor = new URL(next, auth.url).searchParams.get("cursor");
280
+ } catch {
281
+ break;
282
+ }
283
+ if (!nextCursor || seenCursors.has(nextCursor)) break;
284
+ cursor = nextCursor;
261
285
  }
262
286
  if (highWater && highWater !== source.last_cursor) {
263
287
  (0,document_sources/* updateDocumentSourceCursor */.wC)(source.id, highWater);
@@ -705,9 +705,30 @@ async function getGoogleAccessToken(auth) {
705
705
  * @param baseUrl Base for relative `path` (e.g. `https://gmail.googleapis.com/gmail/v1/users/me`).
706
706
  * @param path Either a full URL (starts with `http`) or path appended to baseUrl.
707
707
  */ async function googleFetch(auth, service, baseUrl, path, init) {
708
+ let target;
709
+ try {
710
+ target = path.startsWith("http") ? new URL(path) : new URL(`${baseUrl}${path}`);
711
+ } catch {
712
+ return {
713
+ error: `${service} request URL is invalid.`
714
+ };
715
+ }
716
+ let base;
717
+ try {
718
+ base = new URL(baseUrl);
719
+ } catch {
720
+ return {
721
+ error: `${service} API base URL is invalid.`
722
+ };
723
+ }
724
+ if (target.origin !== base.origin || target.username || target.password) {
725
+ return {
726
+ error: `${service} requests must target ${base.hostname}; refusing to forward credentials.`
727
+ };
728
+ }
729
+ const url = target.toString();
708
730
  const token = await getGoogleAccessToken(auth);
709
731
  if (typeof token !== "string") return token;
710
- const url = path.startsWith("http") ? path : `${baseUrl}${path}`;
711
732
  try {
712
733
  const res = await fetch(url, {
713
734
  ...init,
@@ -812,6 +833,8 @@ const TENANT = process.env.OUTLOOK_TENANT?.trim() || "common";
812
833
  // - Mail.ReadWrite → search/read mail, create drafts, mark read,
813
834
  // move to folders (incl. DeletedItems).
814
835
  // - Mail.Send → send mail when the user explicitly asks for it.
836
+ // - Files.Read.All → Microsoft Search over OneDrive/SharePoint files.
837
+ // - Sites.Read.All → Microsoft Search over SharePoint lists and sites.
815
838
  // - Calendars.ReadWrite → list/get/create/update/delete events on the
816
839
  // user's existing calendars.
817
840
  // - Tasks.ReadWrite → list/get/create/update/complete/delete Microsoft
@@ -823,6 +846,8 @@ const MICROSOFT_SCOPES = [
823
846
  "User.Read",
824
847
  "Mail.ReadWrite",
825
848
  "Mail.Send",
849
+ "Files.Read.All",
850
+ "Sites.Read.All",
826
851
  "Calendars.ReadWrite",
827
852
  "Tasks.ReadWrite",
828
853
  "People.Read"
@@ -998,7 +1023,7 @@ const SCOPE_HINTS = [
998
1023
  },
999
1024
  {
1000
1025
  prefix: "/search/query",
1001
- scope: "Mail.Read Files.Read.All"
1026
+ scope: "Mail.Read / Calendars.Read for mail and events; Files.Read.All for files; Sites.Read.All for lists and sites"
1002
1027
  },
1003
1028
  {
1004
1029
  prefix: "/me",
@@ -1036,7 +1061,20 @@ function backoffFor(attempt) {
1036
1061
  // - 403 Forbidden → surface a scope hint ("reconnect with X") so the
1037
1062
  // operator knows what to grant.
1038
1063
  async function graphFetch(auth, path, init) {
1039
- const url = path.startsWith("http") ? path : `https://graph.microsoft.com/v1.0${path}`;
1064
+ let target;
1065
+ try {
1066
+ target = path.startsWith("http") ? new URL(path) : new URL(`https://graph.microsoft.com/v1.0${path}`);
1067
+ } catch {
1068
+ return {
1069
+ error: "Microsoft Graph request URL is invalid."
1070
+ };
1071
+ }
1072
+ if (target.origin !== "https://graph.microsoft.com" || target.username || target.password) {
1073
+ return {
1074
+ error: "Microsoft Graph requests must target graph.microsoft.com; refusing to forward credentials."
1075
+ };
1076
+ }
1077
+ const url = target.toString();
1040
1078
  let attempt = 0;
1041
1079
  let triedReauth = false;
1042
1080
  while(true){
@@ -784,8 +784,8 @@ const atlassianManifest = {
784
784
  },
785
785
  {
786
786
  check: "credentials",
787
- detail: "An API token created at id.atlassian.com → Security → API tokens. " + "The token is bound to your account email — you'll provide both.",
788
- docs_url: "https://id.atlassian.com/manage-profile/security/api-tokens"
787
+ detail: "An API token created at id.atlassian.com → Security → API tokens. " + "The token is bound to your account email — you'll provide both. For a scoped token, " + "also provide the Atlassian Cloud ID so Jira and Confluence use their product API gateways.",
788
+ docs_url: "https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/"
789
789
  }
790
790
  ],
791
791
  steps: [
@@ -798,7 +798,7 @@ const atlassianManifest = {
798
798
  {
799
799
  id: "save-credentials",
800
800
  title: "Save the credentials in Jarela",
801
- description: "Propose enabling the integration. The user will be asked for the site URL, " + "their account email, and the API token. The token is stored encrypted at rest.",
801
+ description: "Propose enabling the integration. The user will be asked for the site URL, " + "their account email, and the API token. Scoped tokens also need the Cloud ID. " + "The token is stored encrypted at rest.",
802
802
  proposes: "enable_integration"
803
803
  },
804
804
  {
@@ -836,15 +836,15 @@ const githubManifest = {
836
836
  },
837
837
  {
838
838
  check: "credentials",
839
- detail: "A Personal Access Token (classic or fine-grained) created at github.com/settings/tokens. " + "Required scopes: `repo` (or `public_repo` for public-only), plus `read:org` if you target org repos.",
840
- docs_url: "https://github.com/settings/tokens"
839
+ detail: "A Personal Access Token (classic or fine-grained) created at github.com/settings/tokens. " + "Classic tokens need `repo` (or `public_repo` for public-only). Fine-grained tokens need " + "Contents: read, Issues: read/write, and Pull requests: read/write on the selected repositories. " + "`read:org` is only needed for organization-specific operations such as team reviewer lookup.",
840
+ docs_url: "https://docs.github.com/en/rest/overview/permissions-required-for-fine-grained-personal-access-tokens"
841
841
  }
842
842
  ],
843
843
  steps: [
844
844
  {
845
845
  id: "create-pat",
846
846
  title: "Create a GitHub Personal Access Token",
847
- description: "Open github.com/settings/tokens → Generate new token. For classic tokens, tick `repo` (or " + "`public_repo` for public repos only) and `read:org`. For fine-grained tokens, pick the repos and " + "grant Issues: Read+Write and Pull requests: Read+Write. Copy the token immediately — GitHub only " + "shows it once.",
847
+ description: "Open github.com/settings/tokens → Generate new token. For classic tokens, tick `repo` (or " + "`public_repo` for public repos only); add `read:org` only if you need organization team reviewer " + "lookup. For fine-grained tokens, pick the repos and grant Contents: Read-only, Issues: Read+Write, " + "and Pull requests: Read+Write. Copy the token immediately — GitHub only " + "shows it once.",
848
848
  docs_url: "https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens"
849
849
  },
850
850
  {
@@ -1131,13 +1131,13 @@ const openaiCodexManifest = {
1131
1131
  const outlookManifest = {
1132
1132
  id: "outlook",
1133
1133
  name: "Outlook + Microsoft Calendar + To Do",
1134
- summary: "Lets the agent search/read mail, create drafts (never send), move messages between " + "folders, read or modify Microsoft 365 calendar events, and manage Microsoft To Do " + "task lists and tasks. Drafts-only by design — the integration intentionally cannot " + "send mail on the user's behalf.",
1134
+ summary: "Lets the agent search/read mail, create drafts, and send mail when explicitly asked, move messages between " + "folders, read or modify Microsoft 365 calendar events, and manage Microsoft To Do " + "task lists and tasks.",
1135
1135
  category: "mail",
1136
1136
  prerequisites: [
1137
1137
  {
1138
1138
  check: "oauth_app",
1139
- detail: "An Azure app registration with delegated Mail.ReadWrite, Calendars.ReadWrite, " + "Tasks.ReadWrite, User.Read, and offline_access permissions. Both personal Microsoft " + "accounts and M365 work/school accounts are supported via the 'common' tenant.",
1140
- docs_url: "https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade"
1139
+ detail: "An Azure app registration with delegated Mail.ReadWrite, Mail.Send, Calendars.ReadWrite, " + "Tasks.ReadWrite, People.Read, Files.Read.All, Sites.Read.All, User.Read, and offline_access " + "permissions. Files.Read.All and Sites.Read.All enable Microsoft Search across OneDrive/SharePoint. " + "Mail, calendar, and To Do work with personal and M365 accounts; Microsoft Search requires a " + "work/school account. Both account types are supported via the 'common' tenant.",
1140
+ docs_url: "https://learn.microsoft.com/en-us/graph/api/search-query?view=graph-rest-1.0"
1141
1141
  },
1142
1142
  {
1143
1143
  check: "custom",
@@ -1159,7 +1159,7 @@ const outlookManifest = {
1159
1159
  {
1160
1160
  id: "grant-scopes",
1161
1161
  title: "Grant the required Graph permissions",
1162
- description: "API permissions → Add a permission → Microsoft Graph → Delegated permissions. " + "Add Mail.ReadWrite, Calendars.ReadWrite, Tasks.ReadWrite, User.Read, offline_access. " + "No admin consent required for personal accounts; M365 tenants may need an admin to consent."
1162
+ description: "API permissions → Add a permission → Microsoft Graph → Delegated permissions. " + "Add Mail.ReadWrite, Mail.Send, Calendars.ReadWrite, Tasks.ReadWrite, People.Read, " + "Files.Read.All, Sites.Read.All, User.Read, offline_access. " + "No admin consent required for personal accounts; M365 tenants may need an admin to consent."
1163
1163
  },
1164
1164
  {
1165
1165
  id: "save-client",