@mastra/factory 0.25.0-alpha.3 → 0.25.0-alpha.5

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 (301) hide show
  1. package/dist/auth.js +1 -2
  2. package/dist/boards/define-board.js +1 -2
  3. package/dist/boards/index.js +1 -2
  4. package/dist/boards/registry.js +1 -2
  5. package/dist/boards/relocate.js +1 -2
  6. package/dist/boards/review.js +1 -2
  7. package/dist/boards/semantics.js +1 -2
  8. package/dist/boards/transition-policy.js +1 -2
  9. package/dist/boards/work-tool-rules.js +1 -2
  10. package/dist/boards/work-transition-policy.js +1 -2
  11. package/dist/boards/work.js +1 -2
  12. package/dist/environment/build-runner.js +1 -2
  13. package/dist/environment/build-schedule.js +1 -2
  14. package/dist/environment/build-workflow.js +1 -2
  15. package/dist/environment/build.js +1 -2
  16. package/dist/environment/heads.js +1 -2
  17. package/dist/factory.d.ts +4 -2
  18. package/dist/factory.d.ts.map +1 -1
  19. package/dist/factory.js +43 -16
  20. package/dist/factory.js.map +1 -1
  21. package/dist/feed-events.js +1 -2
  22. package/dist/index.js +2 -2
  23. package/dist/integrations/channel-thread-announcements.d.ts +8 -0
  24. package/dist/integrations/channel-thread-announcements.d.ts.map +1 -0
  25. package/dist/integrations/channel-thread-announcements.js +16 -0
  26. package/dist/integrations/channel-thread-announcements.js.map +1 -0
  27. package/dist/integrations/github/acceptance-labels.js +1 -2
  28. package/dist/integrations/github/app-identity.js +1 -2
  29. package/dist/integrations/github/commits.js +1 -2
  30. package/dist/integrations/github/config.js +1 -2
  31. package/dist/integrations/github/default-rules.js +2 -3
  32. package/dist/integrations/github/integration.js +3 -4
  33. package/dist/integrations/github/issue-reconciler.js +1 -2
  34. package/dist/integrations/github/pat.js +1 -2
  35. package/dist/integrations/github/provenance.d.ts.map +1 -1
  36. package/dist/integrations/github/provenance.js +2 -5
  37. package/dist/integrations/github/provenance.js.map +1 -1
  38. package/dist/integrations/github/reconcile-worker.js +1 -2
  39. package/dist/integrations/github/reconciliation-config.js +1 -2
  40. package/dist/integrations/github/routes.js +4 -5
  41. package/dist/integrations/github/rules.d.ts.map +1 -1
  42. package/dist/integrations/github/rules.js +14 -3
  43. package/dist/integrations/github/rules.js.map +1 -1
  44. package/dist/integrations/github/sandbox-release.js +1 -2
  45. package/dist/integrations/github/sandbox.js +1 -2
  46. package/dist/integrations/github/session-subscriptions.js +1 -2
  47. package/dist/integrations/github/settle-or-abort.js +1 -2
  48. package/dist/integrations/github/stale-reviews.js +1 -2
  49. package/dist/integrations/github/subscriptions.js +1 -2
  50. package/dist/integrations/github/token-refresh.js +1 -2
  51. package/dist/integrations/github/webhook.d.ts.map +1 -1
  52. package/dist/integrations/github/webhook.js +17 -3
  53. package/dist/integrations/github/webhook.js.map +1 -1
  54. package/dist/integrations/gitlab/agent-tools.js +1 -2
  55. package/dist/integrations/gitlab/api.js +1 -2
  56. package/dist/integrations/gitlab/default-rules.js +1 -2
  57. package/dist/integrations/gitlab/integration.js +2 -3
  58. package/dist/integrations/gitlab/issue-reconciler.js +1 -2
  59. package/dist/integrations/gitlab/merge-request-reconciler.js +1 -2
  60. package/dist/integrations/gitlab/reconciler.js +1 -2
  61. package/dist/integrations/gitlab/reconciliation-config.js +1 -2
  62. package/dist/integrations/gitlab/routes.js +1 -2
  63. package/dist/integrations/gitlab/rules.js +1 -2
  64. package/dist/integrations/gitlab/session-subscriptions.js +1 -2
  65. package/dist/integrations/gitlab/subscriptions.js +1 -2
  66. package/dist/integrations/gitlab/version-control.js +1 -2
  67. package/dist/integrations/gitlab/webhook-dispatch.js +1 -2
  68. package/dist/integrations/gitlab/webhook.js +1 -2
  69. package/dist/integrations/incidentio/agent-tools.js +1 -2
  70. package/dist/integrations/incidentio/api.js +1 -2
  71. package/dist/integrations/incidentio/claim.js +1 -2
  72. package/dist/integrations/incidentio/default-rules.js +1 -2
  73. package/dist/integrations/incidentio/intake.js +1 -2
  74. package/dist/integrations/incidentio/integration.js +1 -2
  75. package/dist/integrations/incidentio/issue-reconciler.js +1 -2
  76. package/dist/integrations/incidentio/reconciliation-config.js +1 -2
  77. package/dist/integrations/incidentio/routes.js +1 -2
  78. package/dist/integrations/incidentio/rules.js +1 -2
  79. package/dist/integrations/issue-reconcile-worker.js +1 -2
  80. package/dist/integrations/issue-reconciler.js +1 -2
  81. package/dist/integrations/jira/adf.js +1 -2
  82. package/dist/integrations/jira/agent-tools.js +1 -2
  83. package/dist/integrations/jira/api.js +1 -2
  84. package/dist/integrations/jira/claim.js +1 -2
  85. package/dist/integrations/jira/default-rules.js +1 -2
  86. package/dist/integrations/jira/integration.js +1 -2
  87. package/dist/integrations/jira/issue-reconciler.js +1 -2
  88. package/dist/integrations/jira/reconciliation-config.js +1 -2
  89. package/dist/integrations/jira/routes.js +1 -2
  90. package/dist/integrations/jira/rules.js +1 -2
  91. package/dist/integrations/linear/agent-tools.d.ts +1 -1
  92. package/dist/integrations/linear/agent-tools.d.ts.map +1 -1
  93. package/dist/integrations/linear/agent-tools.js +5 -5
  94. package/dist/integrations/linear/agent-tools.js.map +1 -1
  95. package/dist/integrations/linear/claim.js +1 -2
  96. package/dist/integrations/linear/default-rules.js +1 -2
  97. package/dist/integrations/linear/integration.d.ts +2 -0
  98. package/dist/integrations/linear/integration.d.ts.map +1 -1
  99. package/dist/integrations/linear/integration.js +2 -2
  100. package/dist/integrations/linear/integration.js.map +1 -1
  101. package/dist/integrations/linear/issue-reconciler.js +1 -2
  102. package/dist/integrations/linear/reconciliation-config.js +1 -2
  103. package/dist/integrations/linear/routes.js +1 -2
  104. package/dist/integrations/linear/rules.js +1 -2
  105. package/dist/integrations/platform/api-client.js +1 -2
  106. package/dist/integrations/platform/connect/routes.js +1 -2
  107. package/dist/integrations/platform/github/event-worker.js +6 -2
  108. package/dist/integrations/platform/github/event-worker.js.map +1 -1
  109. package/dist/integrations/platform/github/integration.js +1 -2
  110. package/dist/integrations/platform/gitlab/event-worker.js +1 -2
  111. package/dist/integrations/platform/gitlab/integration.js +1 -2
  112. package/dist/integrations/platform/incidentio/integration.js +1 -2
  113. package/dist/integrations/platform/jira/agent-tools.js +1 -2
  114. package/dist/integrations/platform/jira/integration.js +1 -2
  115. package/dist/integrations/platform/jira/routes.js +1 -2
  116. package/dist/integrations/platform/linear/event-worker.js +1 -2
  117. package/dist/integrations/platform/linear/integration.d.ts.map +1 -1
  118. package/dist/integrations/platform/linear/integration.js +2 -2
  119. package/dist/integrations/platform/linear/integration.js.map +1 -1
  120. package/dist/integrations/pull-request-head.js +1 -2
  121. package/dist/integrations/reconciliation-config.js +1 -2
  122. package/dist/integrations/slack/channel-reply-processor.d.ts.map +1 -1
  123. package/dist/integrations/slack/channel-reply-processor.js +11 -5
  124. package/dist/integrations/slack/channel-reply-processor.js.map +1 -1
  125. package/dist/integrations/slack/channel-session-link-processor.js +1 -2
  126. package/dist/integrations/slack/connect-route.js +1 -2
  127. package/dist/integrations/slack/emoji-shortcodes.generated.js +1 -2
  128. package/dist/integrations/slack/emoji.js +1 -2
  129. package/dist/integrations/slack/feed-publisher.js +1 -2
  130. package/dist/integrations/slack/integration.d.ts +5 -0
  131. package/dist/integrations/slack/integration.d.ts.map +1 -1
  132. package/dist/integrations/slack/integration.js +13 -2
  133. package/dist/integrations/slack/integration.js.map +1 -1
  134. package/dist/integrations/slack/reply-reminder-processor.js +1 -2
  135. package/dist/integrations/slack/reply-tool.js +1 -2
  136. package/dist/integrations/slack/share-file-tool.js +1 -2
  137. package/dist/integrations/slack/slack.js +2 -3
  138. package/dist/integrations/subscription-session.js +1 -2
  139. package/dist/integrations/workos/integration.js +1 -2
  140. package/dist/mcp/disconnect.js +1 -2
  141. package/dist/mcp/events.js +2 -3
  142. package/dist/mcp/routes.js +1 -2
  143. package/dist/packages/_internals/workspace/dist/index.js +1 -2
  144. package/dist/packages/_internals/workspace/dist/index.js.map +1 -1
  145. package/dist/platform-auth-host.js +1 -2
  146. package/dist/provider-display-name.js +1 -2
  147. package/dist/review-verdict.d.ts +1 -0
  148. package/dist/review-verdict.d.ts.map +1 -1
  149. package/dist/review-verdict.js +9 -3
  150. package/dist/review-verdict.js.map +1 -1
  151. package/dist/routes/attention-activity.js +1 -2
  152. package/dist/routes/attention-parked.js +1 -2
  153. package/dist/routes/attention-proposed.js +1 -2
  154. package/dist/routes/attention-providers.js +1 -2
  155. package/dist/routes/attention.js +1 -2
  156. package/dist/routes/automation-runs.js +1 -2
  157. package/dist/routes/config.d.ts +4 -0
  158. package/dist/routes/config.d.ts.map +1 -1
  159. package/dist/routes/config.js +7 -2
  160. package/dist/routes/config.js.map +1 -1
  161. package/dist/routes/contracts.js +1 -2
  162. package/dist/routes/custom-provider-source.js +1 -2
  163. package/dist/routes/fs.js +1 -2
  164. package/dist/routes/intake.js +1 -2
  165. package/dist/routes/knowledge.js +1 -2
  166. package/dist/routes/oauth.js +1 -2
  167. package/dist/routes/projects.js +1 -2
  168. package/dist/routes/provider-credentials.js +1 -2
  169. package/dist/routes/route.js +1 -2
  170. package/dist/routes/session-access.js +1 -2
  171. package/dist/routes/skills.js +1 -2
  172. package/dist/routes/source-control-sessions.js +5 -6
  173. package/dist/routes/source-control-settings.js +1 -2
  174. package/dist/routes/surface.js +2 -3
  175. package/dist/routes/telemetry.js +1 -2
  176. package/dist/routes/tenant-credentials.js +1 -2
  177. package/dist/routes/work-items.js +2 -3
  178. package/dist/rules/binding-context.js +1 -2
  179. package/dist/rules/decision-applicability.js +1 -2
  180. package/dist/rules/dispatch-errors.js +1 -2
  181. package/dist/rules/dispatcher.js +1 -2
  182. package/dist/rules/event-rules.js +1 -2
  183. package/dist/rules/processor.js +1 -2
  184. package/dist/rules/resolve.js +1 -2
  185. package/dist/rules/review-source-tool.js +1 -2
  186. package/dist/rules/start-coordinator.js +1 -2
  187. package/dist/rules/terminal-cleanup.js +1 -2
  188. package/dist/rules/tools.js +1 -2
  189. package/dist/rules/transition-service.js +1 -2
  190. package/dist/rules/types.d.ts +4 -1
  191. package/dist/rules/types.d.ts.map +1 -1
  192. package/dist/rules/types.js +1 -2
  193. package/dist/rules/types.js.map +1 -1
  194. package/dist/rules/validation.js +1 -2
  195. package/dist/sandbox/callback-factory-sandbox.js +1 -2
  196. package/dist/sandbox/git-ref.js +1 -2
  197. package/dist/sandbox/local-factory-sandbox.d.ts +12 -4
  198. package/dist/sandbox/local-factory-sandbox.d.ts.map +1 -1
  199. package/dist/sandbox/local-factory-sandbox.js +32 -7
  200. package/dist/sandbox/local-factory-sandbox.js.map +1 -1
  201. package/dist/sandbox/materialization.js +1 -2
  202. package/dist/sandbox/session-retirement.js +1 -2
  203. package/dist/sandbox/session-sandbox.js +1 -2
  204. package/dist/sandbox/workdir.js +1 -2
  205. package/dist/secret-encryption.js +1 -2
  206. package/dist/server-error.js +1 -2
  207. package/dist/session/credential-policy.js +1 -2
  208. package/dist/session/default-model-hydration.js +1 -2
  209. package/dist/session/environment-repositories.js +1 -2
  210. package/dist/session/environment-state-processor.d.ts +0 -1
  211. package/dist/session/environment-state-processor.d.ts.map +1 -1
  212. package/dist/session/environment-state-processor.js +2 -3
  213. package/dist/session/environment-state-processor.js.map +1 -1
  214. package/dist/session/factory-session.js +1 -2
  215. package/dist/session/filesystem-capture.js +2 -3
  216. package/dist/session/filesystem-capture.js.map +1 -1
  217. package/dist/session/first-exec-capture.js +2 -3
  218. package/dist/session/first-exec-capture.js.map +1 -1
  219. package/dist/session/first-message-capture.js +1 -2
  220. package/dist/session/live-sessions.js +1 -2
  221. package/dist/session/memory-settings-hydration.js +1 -2
  222. package/dist/session/org-seed.js +1 -2
  223. package/dist/session/reply-credential-processor.js +1 -2
  224. package/dist/session/resource-migration.js +1 -2
  225. package/dist/session/run-audit.js +1 -2
  226. package/dist/session/session-threads.js +1 -2
  227. package/dist/session/session-title.js +1 -2
  228. package/dist/session/shell-commands.js +1 -2
  229. package/dist/session/source-control-tools.js +2 -3
  230. package/dist/session/thinking-default.js +1 -2
  231. package/dist/session/thread-session-stamp.js +1 -2
  232. package/dist/session/thread-title-mirror.js +1 -2
  233. package/dist/session/thread-title-mirror.js.map +1 -1
  234. package/dist/session/work-item-repository.js +1 -2
  235. package/dist/session-owner-signal.js +1 -2
  236. package/dist/skills/catalog.js +1 -2
  237. package/dist/skills/service.js +1 -2
  238. package/dist/spa-static.js +1 -2
  239. package/dist/state-signing.js +1 -2
  240. package/dist/storage/domains/audit/actions.js +1 -2
  241. package/dist/storage/domains/audit/actors.js +1 -2
  242. package/dist/storage/domains/audit/agent-audit.js +1 -2
  243. package/dist/storage/domains/audit/base.js +1 -2
  244. package/dist/storage/domains/audit/domain.js +1 -2
  245. package/dist/storage/domains/audit/wire.js +1 -2
  246. package/dist/storage/domains/channel-identity/base.js +1 -2
  247. package/dist/storage/domains/comments/activity.js +1 -2
  248. package/dist/storage/domains/comments/actor.js +1 -2
  249. package/dist/storage/domains/comments/base.js +1 -2
  250. package/dist/storage/domains/comments/domain.js +1 -2
  251. package/dist/storage/domains/comments/feed-context.js +1 -2
  252. package/dist/storage/domains/comments/parse.js +1 -2
  253. package/dist/storage/domains/comments/routes.js +1 -2
  254. package/dist/storage/domains/comments/schema.js +1 -2
  255. package/dist/storage/domains/comments/wire.js +1 -2
  256. package/dist/storage/domains/credentials/base.d.ts +4 -1
  257. package/dist/storage/domains/credentials/base.d.ts.map +1 -1
  258. package/dist/storage/domains/credentials/base.js +40 -44
  259. package/dist/storage/domains/credentials/base.js.map +1 -1
  260. package/dist/storage/domains/custom-providers/base.js +1 -2
  261. package/dist/storage/domains/filesystem/base.js +1 -2
  262. package/dist/storage/domains/intake/base.js +1 -2
  263. package/dist/storage/domains/integrations/base.js +1 -2
  264. package/dist/storage/domains/memory-settings/base.js +1 -2
  265. package/dist/storage/domains/model-defaults/base.js +1 -2
  266. package/dist/storage/domains/projects/base.js +1 -2
  267. package/dist/storage/domains/queue-health/base.js +1 -2
  268. package/dist/storage/domains/source-control/base.js +1 -2
  269. package/dist/storage/domains/source-control/inmemory.js +1 -2
  270. package/dist/storage/domains/work-items/base.js +1 -2
  271. package/dist/storage/domains/work-items/board-version.js +1 -2
  272. package/dist/storage/domains/work-items/metrics.js +1 -2
  273. package/dist/telemetry-types.js +1 -2
  274. package/dist/telemetry.js +1 -2
  275. package/dist/timing.js +1 -2
  276. package/dist/tools/annotations.js +1 -2
  277. package/dist/tools/approval-tools.js +1 -2
  278. package/dist/tools/deliver.js +2 -3
  279. package/dist/tools/index.js +1 -2
  280. package/dist/tools/messaging-tools.js +1 -2
  281. package/dist/tools/permissions.js +1 -2
  282. package/dist/tools/read-tools.js +1 -2
  283. package/dist/tools/reports.js +1 -2
  284. package/dist/tools/run-watch.js +1 -2
  285. package/dist/tools/sandbox-tools.js +1 -2
  286. package/dist/tools/scope.js +2 -3
  287. package/dist/tools/session-tools.js +1 -2
  288. package/dist/tools/sessions-state-processor.js +1 -2
  289. package/dist/tools/side-sessions.js +1 -2
  290. package/dist/tools/work-item-tools.js +1 -2
  291. package/dist/work-item-branch.js +1 -2
  292. package/dist/work-item-branch.js.map +1 -1
  293. package/dist/work-items/create-work-item.js +1 -2
  294. package/dist/work-items/decision-actions.js +1 -2
  295. package/dist/workspace.d.ts.map +1 -1
  296. package/dist/workspace.js +1 -3
  297. package/dist/workspace.js.map +1 -1
  298. package/factory-skills/factory-rereview/SKILL.md +12 -2
  299. package/factory-skills/factory-review/SKILL.md +12 -2
  300. package/factory-skills/factory-triage/SKILL.md +7 -7
  301. package/package.json +19 -17
@@ -7,7 +7,7 @@ import { createIncidentioIntake } from "./intake.js";
7
7
  import { attachIncidentioRules } from "./rules.js";
8
8
  import { attachIncidentioIssueReconciler } from "./issue-reconciler.js";
9
9
  import { incidentioReconciliationEnabled, incidentioReconciliationInterval } from "./reconciliation-config.js";
10
- //#region src/integrations/incidentio/integration.ts
10
+ // src/integrations/incidentio/integration.ts
11
11
  const DIRECT_CONNECTION_TOKEN = "incidentio-direct-api-key";
12
12
  const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
13
13
  var IncidentioIntegration = class {
@@ -136,7 +136,6 @@ var IncidentioIntegration = class {
136
136
  };
137
137
  }
138
138
  };
139
- //#endregion
140
139
  export { IncidentioIntegration };
141
140
 
142
141
  //# sourceMappingURL=integration.js.map
@@ -2,7 +2,7 @@ import { workItemPhaseSemantics } from "../../boards/semantics.js";
2
2
  import "../../boards/index.js";
3
3
  import { createIssueReconciler } from "../issue-reconciler.js";
4
4
  import { IncidentioRules } from "./rules.js";
5
- //#region src/integrations/incidentio/issue-reconciler.ts
5
+ // src/integrations/incidentio/issue-reconciler.ts
6
6
  function issueToIngress(itemRef, issue) {
7
7
  return {
8
8
  id: itemRef,
@@ -69,7 +69,6 @@ function attachIncidentioIssueReconciler(incidentio, context) {
69
69
  }
70
70
  });
71
71
  }
72
- //#endregion
73
72
  export { attachIncidentioIssueReconciler };
74
73
 
75
74
  //# sourceMappingURL=issue-reconciler.js.map
@@ -1,5 +1,5 @@
1
1
  import { optionalBoolean, optionalPositiveInteger } from "../reconciliation-config.js";
2
- //#region src/integrations/incidentio/reconciliation-config.ts
2
+ // src/integrations/incidentio/reconciliation-config.ts
3
3
  const RECONCILIATION_LABEL = "incident.io reconciliation";
4
4
  function incidentioReconciliationEnabled() {
5
5
  return optionalBoolean("MASTRACODE_INCIDENT_IO_RECONCILE_ENABLED", process.env.MASTRACODE_INCIDENT_IO_RECONCILE_ENABLED, RECONCILIATION_LABEL) ?? true;
@@ -11,7 +11,6 @@ function incidentioReconciliationInterval() {
11
11
  if (value?.trim() && interval === void 0) console.warn(`[${RECONCILIATION_LABEL}] ${name} must be a positive integer; received ${JSON.stringify(value)}.`);
12
12
  return interval;
13
13
  }
14
- //#endregion
15
14
  export { incidentioReconciliationEnabled, incidentioReconciliationInterval };
16
15
 
17
16
  //# sourceMappingURL=reconciliation-config.js.map
@@ -1,6 +1,6 @@
1
1
  import { IncidentioApiError } from "./api.js";
2
2
  import { registerApiRoute } from "@mastra/core/server";
3
- //#region src/integrations/incidentio/routes.ts
3
+ // src/integrations/incidentio/routes.ts
4
4
  const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
5
5
  const ITEM_REF_RE = /^incidentio:(?:follow-up|incident):[\w-]+$/;
6
6
  const FOLLOW_UP_PREFIX = "incidentio:follow-up:";
@@ -243,7 +243,6 @@ function buildIncidentioRoutes(options) {
243
243
  }));
244
244
  return routes;
245
245
  }
246
- //#endregion
247
246
  export { buildIncidentioRoutes, scopeSourceIdsToProject };
248
247
 
249
248
  //# sourceMappingURL=routes.js.map
@@ -3,7 +3,7 @@ import { boardEventHandlers, boardForWorkItem, eventBoardId, isTerminalWorkItem,
3
3
  import "../../boards/index.js";
4
4
  import { selectEventRule } from "../../rules/event-rules.js";
5
5
  import { incidentioClaimKey } from "./claim.js";
6
- //#region src/integrations/incidentio/rules.ts
6
+ // src/integrations/incidentio/rules.ts
7
7
  const RULE_TIMEOUT_MS = 5e3;
8
8
  async function withRuleTimeout(promise) {
9
9
  let timeout;
@@ -183,7 +183,6 @@ function attachIncidentioRules(incidentio, context) {
183
183
  });
184
184
  return (input) => rules.ingest(input);
185
185
  }
186
- //#endregion
187
186
  export { IncidentioRules, attachIncidentioRules };
188
187
 
189
188
  //# sourceMappingURL=rules.js.map
@@ -1,6 +1,6 @@
1
1
  import { NoopLeaseProvider, isLeaseProvider } from "@mastra/core/events";
2
2
  import { MastraWorker } from "@mastra/core/worker";
3
- //#region src/integrations/issue-reconcile-worker.ts
3
+ // src/integrations/issue-reconcile-worker.ts
4
4
  const DEFAULT_ISSUE_RECONCILE_INTERVAL_MS = 3e5;
5
5
  const MIN_LEASE_TTL_MS = 3e4;
6
6
  var IssueReconcileWorker = class extends MastraWorker {
@@ -91,7 +91,6 @@ function getLeaseProvider(pubsub) {
91
91
  if (typeof getProvider === "function") return getProvider.call(pubsub) ?? NoopLeaseProvider;
92
92
  return isLeaseProvider(pubsub) ? pubsub : pubsub.lease ?? NoopLeaseProvider;
93
93
  }
94
- //#endregion
95
94
  export { DEFAULT_ISSUE_RECONCILE_INTERVAL_MS, IssueReconcileWorker };
96
95
 
97
96
  //# sourceMappingURL=issue-reconcile-worker.js.map
@@ -1,4 +1,4 @@
1
- //#region src/integrations/issue-reconciler.ts
1
+ // src/integrations/issue-reconciler.ts
2
2
  const EXTERNAL_SOURCE_MISSING_KEY = "externalSourceMissingAt";
3
3
  const MISSING_RECHECK_MS = 864e5;
4
4
  function sameValue(left, right) {
@@ -152,7 +152,6 @@ function createIssueReconciler(options) {
152
152
  };
153
153
  return run;
154
154
  }
155
- //#endregion
156
155
  export { EXTERNAL_SOURCE_MISSING_KEY, createIssueReconciler };
157
156
 
158
157
  //# sourceMappingURL=issue-reconciler.js.map
@@ -1,4 +1,4 @@
1
- //#region src/integrations/jira/adf.ts
1
+ // src/integrations/jira/adf.ts
2
2
  /** Flatten an ADF document (or fragment) to plain text. */
3
3
  function adfToText(node) {
4
4
  if (!node || typeof node !== "object") return "";
@@ -67,7 +67,6 @@ function render(node) {
67
67
  }
68
68
  }
69
69
  }
70
- //#endregion
71
70
  export { adfToText, textToAdf };
72
71
 
73
72
  //# sourceMappingURL=adf.js.map
@@ -2,7 +2,7 @@ import { JiraApiError } from "./api.js";
2
2
  import { DEPLOYMENT_CONNECTION } from "./integration.js";
3
3
  import { z } from "zod";
4
4
  import { createTool } from "@mastra/core/tools";
5
- //#region src/integrations/jira/agent-tools.ts
5
+ // src/integrations/jira/agent-tools.ts
6
6
  /**
7
7
  * Prompt-injection boundary: Jira descriptions and comments are authored by
8
8
  * third parties, so the tool labels them as evidence rather than letting them
@@ -81,7 +81,6 @@ async function buildJiraAgentTools({ requestContext, jira }) {
81
81
  jira_create_comment: createJiraCommentTool(jira)
82
82
  };
83
83
  }
84
- //#endregion
85
84
  export { JIRA_UNTRUSTED_CONTENT_NOTICE, buildJiraAgentTools };
86
85
 
87
86
  //# sourceMappingURL=agent-tools.js.map
@@ -1,5 +1,5 @@
1
1
  import { textToAdf } from "./adf.js";
2
- //#region src/integrations/jira/api.ts
2
+ // src/integrations/jira/api.ts
3
3
  const JIRA_TIMEOUT_MS = 15e3;
4
4
  /** Hosts allowed to receive Basic credentials over plain http (local development mocks). */
5
5
  const LOOPBACK_HOSTS = /* @__PURE__ */ new Set([
@@ -139,7 +139,6 @@ var JiraApiClient = class {
139
139
  await this.#request("POST", `/rest/api/3/issue/${encodeURIComponent(keyOrId)}/transitions`, { body: { transition: { id: transitionId } } });
140
140
  }
141
141
  };
142
- //#endregion
143
142
  export { JIRA_COMMENTS_PAGE_SIZE, JIRA_ISSUES_PAGE_SIZE, JIRA_ISSUE_FIELDS, JIRA_PROJECTS_PAGE_SIZE, JiraApiClient, JiraApiError };
144
143
 
145
144
  //# sourceMappingURL=api.js.map
@@ -1,4 +1,4 @@
1
- //#region src/integrations/jira/claim.ts
1
+ // src/integrations/jira/claim.ts
2
2
  /**
3
3
  * Org-wide ownership key for a Jira issue's Factory card. Keyed by the issue
4
4
  * reference the intake feed serves as `id` — the direct integration's stable
@@ -9,7 +9,6 @@
9
9
  function jiraClaimKey(issueRef) {
10
10
  return `jira:issue:${issueRef}`;
11
11
  }
12
- //#endregion
13
12
  export { jiraClaimKey };
14
13
 
15
14
  //# sourceMappingURL=claim.js.map
@@ -1,6 +1,6 @@
1
1
  import { recordExplicitRuleOverrides } from "../../rules/event-rules.js";
2
2
  import { jiraClaimKey } from "./claim.js";
3
- //#region src/integrations/jira/default-rules.ts
3
+ // src/integrations/jira/default-rules.ts
4
4
  function jiraIssueObserved(context) {
5
5
  if (context.item) return;
6
6
  return {
@@ -63,7 +63,6 @@ function resolveJiraRules(overrides) {
63
63
  }
64
64
  return recordExplicitRuleOverrides(Object.freeze(rules), overrides);
65
65
  }
66
- //#endregion
67
66
  export { defaultJiraRules, resolveJiraRules };
68
67
 
69
68
  //# sourceMappingURL=default-rules.js.map
@@ -7,7 +7,7 @@ import { attachJiraIssueReconciler } from "./issue-reconciler.js";
7
7
  import { jiraReconciliationEnabled, jiraReconciliationInterval } from "./reconciliation-config.js";
8
8
  import { buildJiraRoutes } from "./routes.js";
9
9
  import { buildJiraAgentTools } from "./agent-tools.js";
10
- //#region src/integrations/jira/integration.ts
10
+ // src/integrations/jira/integration.ts
11
11
  /** Hard stop for comment pagination so a misbehaving `total` can't loop forever. */
12
12
  const ISSUE_COMMENTS_MAX_PAGES = 20;
13
13
  /** Hard stop for project pagination so a misbehaving `isLast` can't loop forever. */
@@ -401,7 +401,6 @@ function resolveTransition(transitions, target) {
401
401
  const category = STATE_TYPE_TO_CATEGORY[target.stateType];
402
402
  return transitions.find((transition) => transition.to?.statusCategory?.key === category) ?? null;
403
403
  }
404
- //#endregion
405
404
  export { DEPLOYMENT_CONNECTION, JiraIntegration };
406
405
 
407
406
  //# sourceMappingURL=integration.js.map
@@ -2,7 +2,7 @@ import { workItemPhaseSemantics } from "../../boards/semantics.js";
2
2
  import "../../boards/index.js";
3
3
  import { createIssueReconciler } from "../issue-reconciler.js";
4
4
  import { JiraRules } from "./rules.js";
5
- //#region src/integrations/jira/issue-reconciler.ts
5
+ // src/integrations/jira/issue-reconciler.ts
6
6
  function issueToIngress(issueRef, issue) {
7
7
  return {
8
8
  id: issueRef,
@@ -64,7 +64,6 @@ function attachJiraIssueReconciler(jira, context) {
64
64
  }
65
65
  });
66
66
  }
67
- //#endregion
68
67
  export { attachJiraIssueReconciler };
69
68
 
70
69
  //# sourceMappingURL=issue-reconciler.js.map
@@ -1,5 +1,5 @@
1
1
  import { optionalBoolean, optionalPositiveInteger } from "../reconciliation-config.js";
2
- //#region src/integrations/jira/reconciliation-config.ts
2
+ // src/integrations/jira/reconciliation-config.ts
3
3
  const RECONCILIATION_LABEL = "Jira reconciliation";
4
4
  function jiraReconciliationEnabled() {
5
5
  return optionalBoolean("MASTRACODE_JIRA_RECONCILE_ENABLED", process.env.MASTRACODE_JIRA_RECONCILE_ENABLED, RECONCILIATION_LABEL) ?? true;
@@ -11,7 +11,6 @@ function jiraReconciliationInterval() {
11
11
  if (value?.trim() && interval === void 0) console.warn(`[${RECONCILIATION_LABEL}] ${name} must be a positive integer; received ${JSON.stringify(value)}.`);
12
12
  return interval;
13
13
  }
14
- //#endregion
15
14
  export { jiraReconciliationEnabled, jiraReconciliationInterval };
16
15
 
17
16
  //# sourceMappingURL=reconciliation-config.js.map
@@ -1,7 +1,7 @@
1
1
  import { JiraApiError } from "./api.js";
2
2
  import { DEPLOYMENT_CONNECTION } from "./integration.js";
3
3
  import { registerApiRoute } from "@mastra/core/server";
4
- //#region src/integrations/jira/routes.ts
4
+ // src/integrations/jira/routes.ts
5
5
  const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
6
6
  const ISSUE_KEY_RE = /^[A-Za-z][A-Za-z0-9_]*-\d+$/;
7
7
  /** Erase a route handler's path-parameterized context to a plain `Context`. */
@@ -254,7 +254,6 @@ function buildJiraRoutes(options) {
254
254
  }));
255
255
  return routes;
256
256
  }
257
- //#endregion
258
257
  export { buildJiraRoutes };
259
258
 
260
259
  //# sourceMappingURL=routes.js.map
@@ -3,7 +3,7 @@ import { boardEventHandlers, boardForWorkItem, eventBoardId, isTerminalWorkItem,
3
3
  import "../../boards/index.js";
4
4
  import { selectEventRule } from "../../rules/event-rules.js";
5
5
  import { jiraClaimKey } from "./claim.js";
6
- //#region src/integrations/jira/rules.ts
6
+ // src/integrations/jira/rules.ts
7
7
  const RULE_TIMEOUT_MS = 5e3;
8
8
  async function withRuleTimeout(promise) {
9
9
  let timeout;
@@ -183,7 +183,6 @@ function attachJiraRules(jira, context) {
183
183
  });
184
184
  return (input) => rules.ingest(input);
185
185
  }
186
- //#endregion
187
186
  export { JiraRules, attachJiraRules };
188
187
 
189
188
  //# sourceMappingURL=rules.js.map
@@ -14,7 +14,7 @@
14
14
  */
15
15
  import type { RequestContext } from '@mastra/core/request-context';
16
16
  import type { LinearIntegration } from './integration.js';
17
- declare function createLinearGetIssueTool(linear: LinearIntegration, orgId: string): import("@mastra/core/tools").Tool<{
17
+ declare function createLinearGetIssueTool(linear: LinearIntegration, orgId: string, workspaceUrlKey: string | null): import("@mastra/core/tools").Tool<{
18
18
  issue: string;
19
19
  }, unknown, unknown, unknown, import("@mastra/core/tools").ToolExecutionContext<unknown, unknown, unknown>, "linear_get_issue", unknown>;
20
20
  declare function createLinearCommentTool(linear: LinearIntegration, orgId: string): import("@mastra/core/tools").Tool<{
@@ -1 +1 @@
1
- {"version":3,"file":"agent-tools.d.ts","sourceRoot":"","sources":["../../../src/integrations/linear/agent-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAInE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,iBAAS,wBAAwB,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM;;yIA+BzE;AAED,iBAAS,uBAAuB,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM;;;8IAsCxE;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,cAAc,EACd,MAAM,GACP,EAAE;IACD,cAAc,EAAE,cAAc,CAAC;IAC/B,gEAAgE;IAChE,MAAM,EAAE,iBAAiB,CAAC;CAC3B,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAyBpH"}
1
+ {"version":3,"file":"agent-tools.d.ts","sourceRoot":"","sources":["../../../src/integrations/linear/agent-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAInE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,iBAAS,wBAAwB,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI;;yIAkCzG;AAED,iBAAS,uBAAuB,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM;;;8IAsCxE;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,cAAc,EACd,MAAM,GACP,EAAE;IACD,cAAc,EAAE,cAAc,CAAC;IAC/B,gEAAgE;IAChE,MAAM,EAAE,iBAAiB,CAAC;CAC3B,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAyBpH"}
@@ -1,11 +1,12 @@
1
1
  import { LinearReauthRequiredError } from "./integration.js";
2
2
  import { z } from "zod";
3
3
  import { createTool } from "@mastra/core/tools";
4
- //#region src/integrations/linear/agent-tools.ts
5
- function createLinearGetIssueTool(linear, orgId) {
4
+ // src/integrations/linear/agent-tools.ts
5
+ function createLinearGetIssueTool(linear, orgId, workspaceUrlKey) {
6
+ const linkHint = workspaceUrlKey ? ` Issues in this workspace link as https://linear.app/${workspaceUrlKey}/issue/<identifier> (e.g. https://linear.app/${workspaceUrlKey}/issue/ENG-123).` : "";
6
7
  return createTool({
7
8
  id: "linear_get_issue",
8
- description: "Fetch a Linear issue's full details — title, description, state, assignee, labels, priority, and discussion comments. Use this whenever you're working on a Linear issue (e.g. ENG-123) to get its complete context.",
9
+ description: `Fetch a Linear issue's full details — title, description, state, assignee, labels, priority, and discussion comments. Use this whenever you're working on a Linear issue (e.g. ENG-123) to get its complete context.${linkHint}`,
9
10
  inputSchema: z.object({ issue: z.string().min(1).describe("The Linear issue identifier (e.g. \"ENG-123\") or issue UUID.") }),
10
11
  execute: async ({ issue }) => {
11
12
  const connection = await linear.loadConnection(orgId);
@@ -77,11 +78,10 @@ async function buildLinearAgentTools({ requestContext, linear }) {
77
78
  const check = await linear.checkConnection(orgId);
78
79
  if (!check.connected) return {};
79
80
  return {
80
- linear_get_issue: createLinearGetIssueTool(linear, orgId),
81
+ linear_get_issue: createLinearGetIssueTool(linear, orgId, check.workspaceUrlKey),
81
82
  ...check.canComment ? { linear_create_comment: createLinearCommentTool(linear, orgId) } : {}
82
83
  };
83
84
  }
84
- //#endregion
85
85
  export { buildLinearAgentTools };
86
86
 
87
87
  //# sourceMappingURL=agent-tools.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-tools.js","names":[],"sources":["../../../src/integrations/linear/agent-tools.ts"],"sourcesContent":["/**\n * Linear tools exposed to the coding agent.\n *\n * Wired into the agent through the SDK's async `extraTools` provider: on each\n * tool-set resolution we map the session's factory project to its owning org\n * and only expose the Linear tools when that org has a Linear connection.\n * Projects whose org never connected Linear (or when the\n * feature is disabled) see no Linear tools at all — the model is never shown\n * tools it can't use.\n *\n * Tenancy mirrors the Linear API routes: everything is scoped by the org that\n * owns the project, and tokens are refreshed through the integration's shared\n * connection lifecycle.\n */\n\nimport type { AgentControllerRequestContext } from '@mastra/core/agent-controller';\nimport type { RequestContext } from '@mastra/core/request-context';\nimport { createTool } from '@mastra/core/tools';\nimport { z } from 'zod';\n\nimport type { LinearIntegration } from './integration.js';\nimport { LinearReauthRequiredError } from './integration.js';\n\nfunction createLinearGetIssueTool(linear: LinearIntegration, orgId: string) {\n return createTool({\n id: 'linear_get_issue',\n description:\n \"Fetch a Linear issue's full details — title, description, state, assignee, labels, priority, and discussion comments. Use this whenever you're working on a Linear issue (e.g. ENG-123) to get its complete context.\",\n inputSchema: z.object({\n issue: z.string().min(1).describe('The Linear issue identifier (e.g. \"ENG-123\") or issue UUID.'),\n }),\n execute: async ({ issue }: { issue: string }) => {\n const connection = await linear.loadConnection(orgId);\n if (!connection) {\n return { error: 'Linear is not connected for this repository. Connect Linear in Settings to fetch issues.' };\n }\n try {\n const accessToken = await linear.getFreshAccessToken(connection);\n const detail = await linear.intake.getIssue({\n connection: { type: 'oauth', accessToken },\n issueId: issue.trim(),\n });\n if (!detail) {\n return { error: `Linear issue \"${issue}\" was not found in this workspace.` };\n }\n return detail;\n } catch (err) {\n if (err instanceof LinearReauthRequiredError) {\n return { error: err.message };\n }\n return { error: `Failed to fetch Linear issue: ${err instanceof Error ? err.message : String(err)}` };\n }\n },\n });\n}\n\nfunction createLinearCommentTool(linear: LinearIntegration, orgId: string) {\n return createTool({\n id: 'linear_create_comment',\n description:\n 'Post a comment on a Linear issue (e.g. to report investigation findings, link a PR, or ask a clarifying question). The comment is posted as the connected Linear integration, so make clear it comes from the agent.',\n inputSchema: z.object({\n issue: z.string().min(1).describe('The Linear issue identifier (e.g. \"ENG-123\") or issue UUID.'),\n body: z.string().min(1).describe('The comment body, as Linear-flavored markdown.'),\n }),\n execute: async ({ issue, body }: { issue: string; body: string }) => {\n const connection = await linear.loadConnection(orgId);\n if (!connection) {\n return { error: 'Linear is not connected for this repository. Connect Linear in Settings to post comments.' };\n }\n if (!linear.canPostComments(connection)) {\n return {\n error: 'The Linear connection does not have comment permissions. Reconnect Linear in Settings to grant them.',\n };\n }\n try {\n const accessToken = await linear.getFreshAccessToken(connection);\n const comment = await linear.intake.createComment({\n connection: { type: 'oauth', accessToken },\n issueId: issue.trim(),\n body,\n });\n if (!comment) {\n return { error: `Linear issue \"${issue}\" was not found in this workspace.` };\n }\n return { posted: true, url: comment.url };\n } catch (err) {\n if (err instanceof LinearReauthRequiredError) {\n return { error: err.message };\n }\n return { error: `Failed to post Linear comment: ${err instanceof Error ? err.message : String(err)}` };\n }\n },\n });\n}\n\n/**\n * Async `extraTools` provider: expose Linear tools only when the session's\n * project belongs to an org with an active Linear connection.\n */\nexport async function buildLinearAgentTools({\n requestContext,\n linear,\n}: {\n requestContext: RequestContext;\n /** The integration instance providing the Linear API client. */\n linear: LinearIntegration;\n}): Promise<Record<string, ReturnType<typeof createLinearGetIssueTool> | ReturnType<typeof createLinearCommentTool>>> {\n if (!linear.authEnabled) return {};\n\n const ctx = requestContext.get('controller') as\n AgentControllerRequestContext<{ factoryProjectId?: string }> | undefined;\n if (!ctx) return {};\n\n // Prefer the Factory recorded on the session. Factory sessions run under the\n // Factory as their resource, so the resource is the fallback; a legacy\n // session whose resource is its own id resolves to no project.\n const projectId = ctx.getState().factoryProjectId ?? ctx.resourceId;\n if (!projectId) return {};\n\n const orgId = await linear.resolveOrgId(projectId);\n if (!orgId) return {};\n const check = await linear.checkConnection(orgId);\n if (!check.connected) return {};\n\n return {\n linear_get_issue: createLinearGetIssueTool(linear, orgId),\n // Only offered when the granted OAuth scope allows posting comments —\n // connections made before `comments:create` was requested are read-only\n // until the org reconnects Linear.\n ...(check.canComment ? { linear_create_comment: createLinearCommentTool(linear, orgId) } : {}),\n };\n}\n"],"mappings":";;;;AAuBA,SAAS,yBAAyB,QAA2B,OAAe;CAC1E,OAAO,WAAW;EAChB,IAAI;EACJ,aACE;EACF,aAAa,EAAE,OAAO,EACpB,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,+DAA6D,EACjG,CAAC;EACD,SAAS,OAAO,EAAE,YAA+B;GAC/C,MAAM,aAAa,MAAM,OAAO,eAAe,KAAK;GACpD,IAAI,CAAC,YACH,OAAO,EAAE,OAAO,2FAA2F;GAE7G,IAAI;IACF,MAAM,cAAc,MAAM,OAAO,oBAAoB,UAAU;IAC/D,MAAM,SAAS,MAAM,OAAO,OAAO,SAAS;KAC1C,YAAY;MAAE,MAAM;MAAS;KAAY;KACzC,SAAS,MAAM,KAAK;IACtB,CAAC;IACD,IAAI,CAAC,QACH,OAAO,EAAE,OAAO,iBAAiB,MAAM,oCAAoC;IAE7E,OAAO;GACT,SAAS,KAAK;IACZ,IAAI,eAAe,2BACjB,OAAO,EAAE,OAAO,IAAI,QAAQ;IAE9B,OAAO,EAAE,OAAO,iCAAiC,eAAe,QAAQ,IAAI,UAAU,OAAO,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,QAAQ,MAAM,OAAO,aAAa,SAAS;CACjD,IAAI,CAAC,OAAO,OAAO,CAAC;CACpB,MAAM,QAAQ,MAAM,OAAO,gBAAgB,KAAK;CAChD,IAAI,CAAC,MAAM,WAAW,OAAO,CAAC;CAE9B,OAAO;EACL,kBAAkB,yBAAyB,QAAQ,KAAK;EAIxD,GAAI,MAAM,aAAa,EAAE,uBAAuB,wBAAwB,QAAQ,KAAK,EAAE,IAAI,CAAC;CAC9F;AACF"}
1
+ {"version":3,"file":"agent-tools.js","names":[],"sources":["../../../src/integrations/linear/agent-tools.ts"],"sourcesContent":["/**\n * Linear tools exposed to the coding agent.\n *\n * Wired into the agent through the SDK's async `extraTools` provider: on each\n * tool-set resolution we map the session's factory project to its owning org\n * and only expose the Linear tools when that org has a Linear connection.\n * Projects whose org never connected Linear (or when the\n * feature is disabled) see no Linear tools at all — the model is never shown\n * tools it can't use.\n *\n * Tenancy mirrors the Linear API routes: everything is scoped by the org that\n * owns the project, and tokens are refreshed through the integration's shared\n * connection lifecycle.\n */\n\nimport type { AgentControllerRequestContext } from '@mastra/core/agent-controller';\nimport type { RequestContext } from '@mastra/core/request-context';\nimport { createTool } from '@mastra/core/tools';\nimport { z } from 'zod';\n\nimport type { LinearIntegration } from './integration.js';\nimport { LinearReauthRequiredError } from './integration.js';\n\nfunction createLinearGetIssueTool(linear: LinearIntegration, orgId: string, workspaceUrlKey: string | null) {\n // The URL pattern lets the agent link a ticket it mentions without fetching it first.\n const linkHint = workspaceUrlKey\n ? ` Issues in this workspace link as https://linear.app/${workspaceUrlKey}/issue/<identifier> (e.g. https://linear.app/${workspaceUrlKey}/issue/ENG-123).`\n : '';\n return createTool({\n id: 'linear_get_issue',\n description: `Fetch a Linear issue's full details — title, description, state, assignee, labels, priority, and discussion comments. Use this whenever you're working on a Linear issue (e.g. ENG-123) to get its complete context.${linkHint}`,\n inputSchema: z.object({\n issue: z.string().min(1).describe('The Linear issue identifier (e.g. \"ENG-123\") or issue UUID.'),\n }),\n execute: async ({ issue }: { issue: string }) => {\n const connection = await linear.loadConnection(orgId);\n if (!connection) {\n return { error: 'Linear is not connected for this repository. Connect Linear in Settings to fetch issues.' };\n }\n try {\n const accessToken = await linear.getFreshAccessToken(connection);\n const detail = await linear.intake.getIssue({\n connection: { type: 'oauth', accessToken },\n issueId: issue.trim(),\n });\n if (!detail) {\n return { error: `Linear issue \"${issue}\" was not found in this workspace.` };\n }\n return detail;\n } catch (err) {\n if (err instanceof LinearReauthRequiredError) {\n return { error: err.message };\n }\n return { error: `Failed to fetch Linear issue: ${err instanceof Error ? err.message : String(err)}` };\n }\n },\n });\n}\n\nfunction createLinearCommentTool(linear: LinearIntegration, orgId: string) {\n return createTool({\n id: 'linear_create_comment',\n description:\n 'Post a comment on a Linear issue (e.g. to report investigation findings, link a PR, or ask a clarifying question). The comment is posted as the connected Linear integration, so make clear it comes from the agent.',\n inputSchema: z.object({\n issue: z.string().min(1).describe('The Linear issue identifier (e.g. \"ENG-123\") or issue UUID.'),\n body: z.string().min(1).describe('The comment body, as Linear-flavored markdown.'),\n }),\n execute: async ({ issue, body }: { issue: string; body: string }) => {\n const connection = await linear.loadConnection(orgId);\n if (!connection) {\n return { error: 'Linear is not connected for this repository. Connect Linear in Settings to post comments.' };\n }\n if (!linear.canPostComments(connection)) {\n return {\n error: 'The Linear connection does not have comment permissions. Reconnect Linear in Settings to grant them.',\n };\n }\n try {\n const accessToken = await linear.getFreshAccessToken(connection);\n const comment = await linear.intake.createComment({\n connection: { type: 'oauth', accessToken },\n issueId: issue.trim(),\n body,\n });\n if (!comment) {\n return { error: `Linear issue \"${issue}\" was not found in this workspace.` };\n }\n return { posted: true, url: comment.url };\n } catch (err) {\n if (err instanceof LinearReauthRequiredError) {\n return { error: err.message };\n }\n return { error: `Failed to post Linear comment: ${err instanceof Error ? err.message : String(err)}` };\n }\n },\n });\n}\n\n/**\n * Async `extraTools` provider: expose Linear tools only when the session's\n * project belongs to an org with an active Linear connection.\n */\nexport async function buildLinearAgentTools({\n requestContext,\n linear,\n}: {\n requestContext: RequestContext;\n /** The integration instance providing the Linear API client. */\n linear: LinearIntegration;\n}): Promise<Record<string, ReturnType<typeof createLinearGetIssueTool> | ReturnType<typeof createLinearCommentTool>>> {\n if (!linear.authEnabled) return {};\n\n const ctx = requestContext.get('controller') as\n AgentControllerRequestContext<{ factoryProjectId?: string }> | undefined;\n if (!ctx) return {};\n\n // Prefer the Factory recorded on the session. Factory sessions run under the\n // Factory as their resource, so the resource is the fallback; a legacy\n // session whose resource is its own id resolves to no project.\n const projectId = ctx.getState().factoryProjectId ?? ctx.resourceId;\n if (!projectId) return {};\n\n const orgId = await linear.resolveOrgId(projectId);\n if (!orgId) return {};\n const check = await linear.checkConnection(orgId);\n if (!check.connected) return {};\n\n return {\n linear_get_issue: createLinearGetIssueTool(linear, orgId, check.workspaceUrlKey),\n // Only offered when the granted OAuth scope allows posting comments —\n // connections made before `comments:create` was requested are read-only\n // until the org reconnects Linear.\n ...(check.canComment ? { linear_create_comment: createLinearCommentTool(linear, orgId) } : {}),\n };\n}\n"],"mappings":";;;;AAuBA,SAAS,yBAAyB,QAA2B,OAAe,iBAAgC;CAE1G,MAAM,WAAW,kBACb,wDAAwD,gBAAgB,+CAA+C,gBAAgB,oBACvI;CACJ,OAAO,WAAW;EAChB,IAAI;EACJ,aAAa,uNAAuN;EACpO,aAAa,EAAE,OAAO,EACpB,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,+DAA6D,EACjG,CAAC;EACD,SAAS,OAAO,EAAE,YAA+B;GAC/C,MAAM,aAAa,MAAM,OAAO,eAAe,KAAK;GACpD,IAAI,CAAC,YACH,OAAO,EAAE,OAAO,2FAA2F;GAE7G,IAAI;IACF,MAAM,cAAc,MAAM,OAAO,oBAAoB,UAAU;IAC/D,MAAM,SAAS,MAAM,OAAO,OAAO,SAAS;KAC1C,YAAY;MAAE,MAAM;MAAS;KAAY;KACzC,SAAS,MAAM,KAAK;IACt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;CACpH,IAAI,CAAC,OAAO,aAAa,OAAO,CAAC;CAEjC,MAAM,MAAM,eAAe,IAAI,YAAY;CAE3C,IAAI,CAAC,KAAK,OAAO,CAAC;CAKlB,MAAM,YAAY,IAAI,SAAS,CAAC,CAAC,oBAAoB,IAAI;CACzD,IAAI,CAAC,WAAW,OAAO,CAAC;CAExB,MAAM,QAAQ,MAAM,OAAO,aAAa,SAAS;CACjD,IAAI,CAAC,OAAO,OAAO,CAAC;CACpB,MAAM,QAAQ,MAAM,OAAO,gBAAgB,KAAK;CAChD,IAAI,CAAC,MAAM,WAAW,OAAO,CAAC;CAE9B,OAAO;EACL,kBAAkB,yBAAyB,QAAQ,OAAO,MAAM,eAAe;EAI/E,GAAI,MAAM,aAAa,EAAE,uBAAuB,wBAAwB,QAAQ,KAAK,EAAE,IAAI,CAAC;CAC9F;AACF"}
@@ -1,4 +1,4 @@
1
- //#region src/integrations/linear/claim.ts
1
+ // src/integrations/linear/claim.ts
2
2
  /**
3
3
  * Org-wide ownership key for a Linear issue's Factory card. Keyed by the issue's
4
4
  * stable UUID, never its human identifier: identifiers change when an issue
@@ -8,7 +8,6 @@
8
8
  function linearClaimKey(issueId) {
9
9
  return `linear:issue:${issueId}`;
10
10
  }
11
- //#endregion
12
11
  export { linearClaimKey };
13
12
 
14
13
  //# sourceMappingURL=claim.js.map
@@ -1,6 +1,6 @@
1
1
  import { recordExplicitRuleOverrides } from "../../rules/event-rules.js";
2
2
  import { linearClaimKey } from "./claim.js";
3
- //#region src/integrations/linear/default-rules.ts
3
+ // src/integrations/linear/default-rules.ts
4
4
  function linearIssueObserved(context) {
5
5
  if (context.item) return;
6
6
  return {
@@ -64,7 +64,6 @@ function resolveLinearRules(overrides) {
64
64
  }
65
65
  return recordExplicitRuleOverrides(Object.freeze(rules), overrides);
66
66
  }
67
- //#endregion
68
67
  export { defaultLinearRules, resolveLinearRules };
69
68
 
70
69
  //# sourceMappingURL=default-rules.js.map
@@ -133,6 +133,8 @@ export interface LinearConnectionCheck {
133
133
  connected: boolean;
134
134
  /** Whether the granted OAuth scope allows posting issue comments. */
135
135
  canComment: boolean;
136
+ /** Linear workspace slug, for `https://linear.app/<urlKey>/issue/<ID>` links. */
137
+ workspaceUrlKey: string | null;
136
138
  checkedAt: number;
137
139
  }
138
140
  export declare class LinearIntegration implements FactoryIntegration {
@@ -1 +1 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/integrations/linear/integration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAGV,MAAM,EAKP,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAC3F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAMhF,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAM1G,6EAA6E;AAC7E,MAAM,WAAW,uBAAuB;IACtC,6EAA6E;IAC7E,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,WAA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IssueReconciler } from "./issue-reconciler.js";
5
5
  import { linearIssueReconciliationEnabled, linearIssueReconciliationInterval } from "./reconciliation-config.js";
6
6
  import { buildLinearRoutes } from "./routes.js";
7
7
  import { buildLinearAgentTools } from "./agent-tools.js";
8
- //#region src/integrations/linear/integration.ts
8
+ // src/integrations/linear/integration.ts
9
9
  const LINEAR_GRAPHQL_URL = "https://api.linear.app/graphql";
10
10
  const LINEAR_TOKEN_URL = "https://api.linear.app/oauth/token";
11
11
  const LINEAR_AUTHORIZE_URL = "https://linear.app/oauth/authorize";
@@ -189,6 +189,7 @@ var LinearIntegration = class {
189
189
  const check = {
190
190
  connected: connection !== null,
191
191
  canComment: connection !== null && this.canPostComments(connection),
192
+ workspaceUrlKey: connection?.workspaceUrlKey ?? null,
192
193
  checkedAt: Date.now()
193
194
  };
194
195
  this.#connectionChecks.set(orgId, check);
@@ -894,7 +895,6 @@ function linearIssueToIntakeIssue(issue) {
894
895
  updatedAt: issue.updatedAt
895
896
  };
896
897
  }
897
- //#endregion
898
898
  export { LinearIntegration, LinearReauthRequiredError };
899
899
 
900
900
  //# sourceMappingURL=integration.js.map