@mastra/factory 0.21.0-alpha.4 → 0.21.0-alpha.6

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 (42) hide show
  1. package/dist/boards/relocate.d.ts +2 -2
  2. package/dist/boards/relocate.d.ts.map +1 -1
  3. package/dist/boards/relocate.js +5 -4
  4. package/dist/boards/relocate.js.map +1 -1
  5. package/dist/factory.d.ts.map +1 -1
  6. package/dist/factory.js +2 -0
  7. package/dist/factory.js.map +1 -1
  8. package/dist/integrations/github/rules.d.ts +0 -7
  9. package/dist/integrations/github/rules.d.ts.map +1 -1
  10. package/dist/integrations/github/rules.js +14 -3
  11. package/dist/integrations/github/rules.js.map +1 -1
  12. package/dist/integrations/gitlab/rules.d.ts.map +1 -1
  13. package/dist/integrations/gitlab/rules.js +17 -3
  14. package/dist/integrations/gitlab/rules.js.map +1 -1
  15. package/dist/integrations/incidentio/rules.d.ts.map +1 -1
  16. package/dist/integrations/incidentio/rules.js +14 -3
  17. package/dist/integrations/incidentio/rules.js.map +1 -1
  18. package/dist/integrations/jira/rules.d.ts.map +1 -1
  19. package/dist/integrations/jira/rules.js +14 -3
  20. package/dist/integrations/jira/rules.js.map +1 -1
  21. package/dist/integrations/linear/rules.d.ts.map +1 -1
  22. package/dist/integrations/linear/rules.js +14 -3
  23. package/dist/integrations/linear/rules.js.map +1 -1
  24. package/dist/routes/automation-runs.d.ts.map +1 -1
  25. package/dist/routes/automation-runs.js +4 -1
  26. package/dist/routes/automation-runs.js.map +1 -1
  27. package/dist/routes/config.d.ts +6 -0
  28. package/dist/routes/config.d.ts.map +1 -1
  29. package/dist/routes/config.js +30 -2
  30. package/dist/routes/config.js.map +1 -1
  31. package/dist/routes/surface.d.ts +2 -0
  32. package/dist/routes/surface.d.ts.map +1 -1
  33. package/dist/routes/surface.js +1 -0
  34. package/dist/routes/surface.js.map +1 -1
  35. package/dist/rules/dispatcher.d.ts.map +1 -1
  36. package/dist/rules/dispatcher.js +1 -0
  37. package/dist/rules/dispatcher.js.map +1 -1
  38. package/dist/storage/domains/work-items/base.d.ts +4 -0
  39. package/dist/storage/domains/work-items/base.d.ts.map +1 -1
  40. package/dist/storage/domains/work-items/base.js +4 -4
  41. package/dist/storage/domains/work-items/base.js.map +1 -1
  42. package/package.json +6 -6
@@ -3,8 +3,8 @@ import type { BoardRegistry } from './registry.js';
3
3
  /** Rows that predate persisted boards used source-type routing. */
4
4
  export declare function effectiveBoard(item: WorkItemRow): string;
5
5
  /**
6
- * Put one card on `targetBoard`, at `targetStage` or the board's initial phase. Terminal cards and
7
- * cards with a session attached to a current stage stay put; so does a card that changed under us
6
+ * Put one card on `targetBoard`, at `targetStage` or the board's initial phase. Terminal cards,
7
+ * cards on a board that is not installed, and cards with a session attached to a current stage stay put; so does a card that changed under us
8
8
  * (a run started or someone moved it), a card already on the target board when no phase is named,
9
9
  * and a card already sitting at the named destination.
10
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"relocate.d.ts","sourceRoot":"","sources":["../../src/boards/relocate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,mEAAmE;AACnE,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,EACpC,SAAS,EACT,aAAa,EACb,MAAM,EACN,IAAI,EACJ,WAAW,EACX,WAAW,GACZ,EAAE;IACD,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,+BAA+B,CAAC,CAAC;IAC9E,aAAa,EAAE,aAAa,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC,CA+C7C;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,EAAE,CAGtD"}
1
+ {"version":3,"file":"relocate.d.ts","sourceRoot":"","sources":["../../src/boards/relocate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,mEAAmE;AACnE,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,EACpC,SAAS,EACT,aAAa,EACb,MAAM,EACN,IAAI,EACJ,WAAW,EACX,WAAW,GACZ,EAAE;IACD,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,+BAA+B,CAAC,CAAC;IAC9E,aAAa,EAAE,aAAa,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC,CAiD7C;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,EAAE,CAGtD"}
@@ -5,8 +5,8 @@ function effectiveBoard(item) {
5
5
  return item.board ?? (item.externalSource?.type === "pull-request" ? "review" : "work");
6
6
  }
7
7
  /**
8
- * Put one card on `targetBoard`, at `targetStage` or the board's initial phase. Terminal cards and
9
- * cards with a session attached to a current stage stay put; so does a card that changed under us
8
+ * Put one card on `targetBoard`, at `targetStage` or the board's initial phase. Terminal cards,
9
+ * cards on a board that is not installed, and cards with a session attached to a current stage stay put; so does a card that changed under us
10
10
  * (a run started or someone moved it), a card already on the target board when no phase is named,
11
11
  * and a card already sitting at the named destination.
12
12
  */
@@ -18,9 +18,10 @@ async function moveCardToBoard({ workItems, boardRegistry, userId, item, targetB
18
18
  const currentBoard = effectiveBoard(item);
19
19
  if (currentBoard === targetBoard && (targetStage === void 0 || item.stages.length === 1 && item.stages[0] === stage)) return "unchanged";
20
20
  const current = boardRegistry.get(currentBoard);
21
+ if (!current) return "skipped";
21
22
  if (!item.stages.every((currentStage) => {
22
- if (current?.phases[currentStage]?.kind === "terminal") return false;
23
- const role = current?.roleForPhase(currentStage);
23
+ if (current.phases[currentStage]?.kind === "terminal") return false;
24
+ const role = current.roleForPhase(currentStage);
24
25
  return role === void 0 || item.sessions[role] === void 0;
25
26
  })) return "skipped";
26
27
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"relocate.js","names":[],"sources":["../../src/boards/relocate.ts"],"sourcesContent":["import { WorkItemUpdateConflictError } from '../storage/domains/work-items/base.js';\nimport type { WorkItemRow, WorkItemsStorage } from '../storage/domains/work-items/base.js';\nimport type { BoardRegistry } from './registry.js';\n\n/** Rows that predate persisted boards used source-type routing. */\nexport function effectiveBoard(item: WorkItemRow): string {\n return item.board ?? (item.externalSource?.type === 'pull-request' ? 'review' : 'work');\n}\n\n/**\n * Put one card on `targetBoard`, at `targetStage` or the board's initial phase. Terminal cards and\n * cards with a session attached to a current stage stay put; so does a card that changed under us\n * (a run started or someone moved it), a card already on the target board when no phase is named,\n * and a card already sitting at the named destination.\n */\nexport async function moveCardToBoard({\n workItems,\n boardRegistry,\n userId,\n item,\n targetBoard,\n targetStage,\n}: {\n workItems: Pick<WorkItemsStorage, 'update' | 'supersedeDecisionsForWorkItem'>;\n boardRegistry: BoardRegistry;\n userId: string;\n item: WorkItemRow;\n targetBoard: string;\n /** Phase to file the card on; defaults to the target board's initial phase. */\n targetStage?: string;\n}): Promise<'moved' | 'skipped' | 'unchanged'> {\n const target = boardRegistry.get(targetBoard);\n if (!target) return 'unchanged';\n const stage = targetStage ?? target.initialPhase;\n // An unknown phase is not a placement this board can hold.\n if (targetStage !== undefined && target.phases[targetStage] === undefined) return 'unchanged';\n const currentBoard = effectiveBoard(item);\n // A caller that names no phase is asking for the board's landing spot, and a\n // card already on that board is where it needs to be — dragging a card out of\n // a working phase back to the initial one is not what a rebind or a label\n // route change means. A named phase is a placement, so the destination being\n // identical — board *and* phase — is the only case with nothing to do.\n if (\n currentBoard === targetBoard &&\n (targetStage === undefined || (item.stages.length === 1 && item.stages[0] === stage))\n )\n return 'unchanged';\n const current = boardRegistry.get(currentBoard);\n // Sessions are keyed by the phase's role, not the phase id.\n const movable = item.stages.every(currentStage => {\n if (current?.phases[currentStage]?.kind === 'terminal') return false;\n const role = current?.roleForPhase(currentStage);\n return role === undefined || item.sessions[role] === undefined;\n });\n if (!movable) return 'skipped';\n try {\n const updated = await workItems.update({\n orgId: item.orgId,\n id: item.id,\n userId,\n patch: { board: targetBoard, stages: [stage] },\n expectedRevision: item.revision,\n expectedBoard: item.board,\n });\n if (!updated) return 'skipped';\n // Runs proposed by the old board's phases (e.g. Work's triage) mean nothing on the new board.\n await workItems.supersedeDecisionsForWorkItem({\n orgId: item.orgId,\n factoryProjectId: item.factoryProjectId,\n workItemId: item.id,\n supersededAt: new Date(),\n });\n return 'moved';\n } catch (error) {\n if (!(error instanceof WorkItemUpdateConflictError)) throw error;\n return 'skipped';\n }\n}\n\nexport function cardLabels(item: WorkItemRow): string[] {\n const labels = item.metadata?.labels;\n return Array.isArray(labels) ? labels.filter((label): label is string => typeof label === 'string') : [];\n}\n"],"mappings":";;;AAKA,SAAgB,eAAe,MAA2B;CACxD,OAAO,KAAK,UAAU,KAAK,gBAAgB,SAAS,iBAAiB,WAAW;AAClF;;;;;;;AAQA,eAAsB,gBAAgB,EACpC,WACA,eACA,QACA,MACA,aACA,eAS6C;CAC7C,MAAM,SAAS,cAAc,IAAI,WAAW;CAC5C,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,QAAQ,eAAe,OAAO;CAEpC,IAAI,gBAAgB,KAAA,KAAa,OAAO,OAAO,iBAAiB,KAAA,GAAW,OAAO;CAClF,MAAM,eAAe,eAAe,IAAI;CAMxC,IACE,iBAAiB,gBAChB,gBAAgB,KAAA,KAAc,KAAK,OAAO,WAAW,KAAK,KAAK,OAAO,OAAO,QAE9E,OAAO;CACT,MAAM,UAAU,cAAc,IAAI,YAAY;CAO9C,IAAI,CALY,KAAK,OAAO,OAAM,iBAAgB;EAChD,IAAI,SAAS,OAAO,aAAa,EAAE,SAAS,YAAY,OAAO;EAC/D,MAAM,OAAO,SAAS,aAAa,YAAY;EAC/C,OAAO,SAAS,KAAA,KAAa,KAAK,SAAS,UAAU,KAAA;CACvD,CACW,GAAG,OAAO;CACrB,IAAI;EASF,IAAI,CAAC,MARiB,UAAU,OAAO;GACrC,OAAO,KAAK;GACZ,IAAI,KAAK;GACT;GACA,OAAO;IAAE,OAAO;IAAa,QAAQ,CAAC,KAAK;GAAE;GAC7C,kBAAkB,KAAK;GACvB,eAAe,KAAK;EACtB,CAAC,GACa,OAAO;EAErB,MAAM,UAAU,8BAA8B;GAC5C,OAAO,KAAK;GACZ,kBAAkB,KAAK;GACvB,YAAY,KAAK;GACjB,8BAAc,IAAI,KAAK;EACzB,CAAC;EACD,OAAO;CACT,SAAS,OAAO;EACd,IAAI,EAAE,iBAAiB,8BAA8B,MAAM;EAC3D,OAAO;CACT;AACF;AAEA,SAAgB,WAAW,MAA6B;CACtD,MAAM,SAAS,KAAK,UAAU;CAC9B,OAAO,MAAM,QAAQ,MAAM,IAAI,OAAO,QAAQ,UAA2B,OAAO,UAAU,QAAQ,IAAI,CAAC;AACzG"}
1
+ {"version":3,"file":"relocate.js","names":[],"sources":["../../src/boards/relocate.ts"],"sourcesContent":["import { WorkItemUpdateConflictError } from '../storage/domains/work-items/base.js';\nimport type { WorkItemRow, WorkItemsStorage } from '../storage/domains/work-items/base.js';\nimport type { BoardRegistry } from './registry.js';\n\n/** Rows that predate persisted boards used source-type routing. */\nexport function effectiveBoard(item: WorkItemRow): string {\n return item.board ?? (item.externalSource?.type === 'pull-request' ? 'review' : 'work');\n}\n\n/**\n * Put one card on `targetBoard`, at `targetStage` or the board's initial phase. Terminal cards,\n * cards on a board that is not installed, and cards with a session attached to a current stage stay put; so does a card that changed under us\n * (a run started or someone moved it), a card already on the target board when no phase is named,\n * and a card already sitting at the named destination.\n */\nexport async function moveCardToBoard({\n workItems,\n boardRegistry,\n userId,\n item,\n targetBoard,\n targetStage,\n}: {\n workItems: Pick<WorkItemsStorage, 'update' | 'supersedeDecisionsForWorkItem'>;\n boardRegistry: BoardRegistry;\n userId: string;\n item: WorkItemRow;\n targetBoard: string;\n /** Phase to file the card on; defaults to the target board's initial phase. */\n targetStage?: string;\n}): Promise<'moved' | 'skipped' | 'unchanged'> {\n const target = boardRegistry.get(targetBoard);\n if (!target) return 'unchanged';\n const stage = targetStage ?? target.initialPhase;\n // An unknown phase is not a placement this board can hold.\n if (targetStage !== undefined && target.phases[targetStage] === undefined) return 'unchanged';\n const currentBoard = effectiveBoard(item);\n // A caller that names no phase is asking for the board's landing spot, and a\n // card already on that board is where it needs to be — dragging a card out of\n // a working phase back to the initial one is not what a rebind or a label\n // route change means. A named phase is a placement, so the destination being\n // identical — board *and* phase — is the only case with nothing to do.\n if (\n currentBoard === targetBoard &&\n (targetStage === undefined || (item.stages.length === 1 && item.stages[0] === stage))\n )\n return 'unchanged';\n const current = boardRegistry.get(currentBoard);\n // Without the board definition we can't tell terminal phases or attached sessions apart, so leave the card alone.\n if (!current) return 'skipped';\n // Sessions are keyed by the phase's role, not the phase id.\n const movable = item.stages.every(currentStage => {\n if (current.phases[currentStage]?.kind === 'terminal') return false;\n const role = current.roleForPhase(currentStage);\n return role === undefined || item.sessions[role] === undefined;\n });\n if (!movable) return 'skipped';\n try {\n const updated = await workItems.update({\n orgId: item.orgId,\n id: item.id,\n userId,\n patch: { board: targetBoard, stages: [stage] },\n expectedRevision: item.revision,\n expectedBoard: item.board,\n });\n if (!updated) return 'skipped';\n // Runs proposed by the old board's phases (e.g. Work's triage) mean nothing on the new board.\n await workItems.supersedeDecisionsForWorkItem({\n orgId: item.orgId,\n factoryProjectId: item.factoryProjectId,\n workItemId: item.id,\n supersededAt: new Date(),\n });\n return 'moved';\n } catch (error) {\n if (!(error instanceof WorkItemUpdateConflictError)) throw error;\n return 'skipped';\n }\n}\n\nexport function cardLabels(item: WorkItemRow): string[] {\n const labels = item.metadata?.labels;\n return Array.isArray(labels) ? labels.filter((label): label is string => typeof label === 'string') : [];\n}\n"],"mappings":";;;AAKA,SAAgB,eAAe,MAA2B;CACxD,OAAO,KAAK,UAAU,KAAK,gBAAgB,SAAS,iBAAiB,WAAW;AAClF;;;;;;;AAQA,eAAsB,gBAAgB,EACpC,WACA,eACA,QACA,MACA,aACA,eAS6C;CAC7C,MAAM,SAAS,cAAc,IAAI,WAAW;CAC5C,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,QAAQ,eAAe,OAAO;CAEpC,IAAI,gBAAgB,KAAA,KAAa,OAAO,OAAO,iBAAiB,KAAA,GAAW,OAAO;CAClF,MAAM,eAAe,eAAe,IAAI;CAMxC,IACE,iBAAiB,gBAChB,gBAAgB,KAAA,KAAc,KAAK,OAAO,WAAW,KAAK,KAAK,OAAO,OAAO,QAE9E,OAAO;CACT,MAAM,UAAU,cAAc,IAAI,YAAY;CAE9C,IAAI,CAAC,SAAS,OAAO;CAOrB,IAAI,CALY,KAAK,OAAO,OAAM,iBAAgB;EAChD,IAAI,QAAQ,OAAO,aAAa,EAAE,SAAS,YAAY,OAAO;EAC9D,MAAM,OAAO,QAAQ,aAAa,YAAY;EAC9C,OAAO,SAAS,KAAA,KAAa,KAAK,SAAS,UAAU,KAAA;CACvD,CACW,GAAG,OAAO;CACrB,IAAI;EASF,IAAI,CAAC,MARiB,UAAU,OAAO;GACrC,OAAO,KAAK;GACZ,IAAI,KAAK;GACT;GACA,OAAO;IAAE,OAAO;IAAa,QA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AAkB,EAAE,CAAC;IACpC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IACnC,gFAAgF;IAChF,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT,sGAAsG;QACtG,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB;;;;;;WAMG;QACH,MAAM,CAAC,EAAE;YACP,uFAAuF;YACvF,KAAK,CAAC,EAAE,mBAAmB,CAAC;YAC5B;;;eAGG;YACH,IAAI,CAAC,EAAE,MAAM,CAAC;SACf,CAAC;KACH,CAAC;CACH;AAED,YAAY,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAmFD,qBAAa,aAAa;;gBASZ,MAAM,EAAE,mBAAmB;IAsBvC;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC;IA6qCpC;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAY/B,iFAAiF;IAC3E,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAGhC"}
package/dist/factory.js CHANGED
@@ -325,6 +325,7 @@ var MastraFactory = class {
325
325
  const intakeReady = integrations.some((integration) => integration.intake !== void 0) && storage.isDomainReady("intake");
326
326
  const factoryReady = storage.isDomainReady("projects") && storage.isDomainReady("work-items");
327
327
  const knowledgeEnabled = this.#config.knowledge !== void 0 || process.env.MASTRACODE_EXPERIMENTAL_SUBCONSCIOUS === "1";
328
+ const deploymentOrganizationId = process.env.MASTRACODE_DEPLOYMENT_ORGANIZATION_ID?.trim() || void 0;
328
329
  const githubIntegration = integrations.find((integration) => integration.id === "github");
329
330
  const gitlabIntegration = integrations.find((integration) => integration.id === "gitlab" && integration.intake && integration.versionControl);
330
331
  const workItemsReady = storage.isDomainReady("work-items");
@@ -697,6 +698,7 @@ var MastraFactory = class {
697
698
  intakeReady,
698
699
  factoryReady,
699
700
  knowledgeEnabled,
701
+ deploymentOrganizationId,
700
702
  deploymentModelProviders,
701
703
  knowledgeKey: this.#config.knowledge?.key,
702
704
  configVersion,