@mastra/factory 0.13.0-alpha.9 → 0.13.0
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.
- package/README.md +232 -10
- package/dist/auth.d.ts +2 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +29 -4
- package/dist/auth.js.map +1 -1
- package/dist/boards/define-board.d.ts +36 -2
- package/dist/boards/define-board.d.ts.map +1 -1
- package/dist/boards/define-board.js +58 -1
- package/dist/boards/define-board.js.map +1 -1
- package/dist/boards/index.d.ts +4 -2
- package/dist/boards/index.d.ts.map +1 -1
- package/dist/boards/index.js +2 -1
- package/dist/boards/index.js.map +1 -1
- package/dist/boards/relocate.d.ts +17 -0
- package/dist/boards/relocate.d.ts.map +1 -0
- package/dist/boards/relocate.js +53 -0
- package/dist/boards/relocate.js.map +1 -0
- package/dist/boards/review.d.ts +1 -1
- package/dist/boards/review.d.ts.map +1 -1
- package/dist/boards/review.js +17 -4
- package/dist/boards/review.js.map +1 -1
- package/dist/boards/semantics.d.ts +28 -0
- package/dist/boards/semantics.d.ts.map +1 -0
- package/dist/boards/semantics.js +41 -0
- package/dist/boards/semantics.js.map +1 -0
- package/dist/boards/work-tool-rules.d.ts +8 -0
- package/dist/boards/work-tool-rules.d.ts.map +1 -0
- package/dist/boards/work-tool-rules.js +20 -0
- package/dist/boards/work-tool-rules.js.map +1 -0
- package/dist/boards/work.d.ts +1 -1
- package/dist/boards/work.d.ts.map +1 -1
- package/dist/boards/work.js +13 -0
- package/dist/boards/work.js.map +1 -1
- package/dist/capabilities/intake.d.ts +2 -0
- package/dist/capabilities/intake.d.ts.map +1 -1
- package/dist/factory.d.ts +5 -6
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +41 -12
- package/dist/factory.js.map +1 -1
- package/dist/integrations/base.d.ts +7 -4
- package/dist/integrations/base.d.ts.map +1 -1
- package/dist/integrations/github/default-rules.d.ts +2 -2
- package/dist/integrations/github/default-rules.d.ts.map +1 -1
- package/dist/integrations/github/default-rules.js +2 -2
- package/dist/integrations/github/default-rules.js.map +1 -1
- package/dist/integrations/github/issue-reconciler.d.ts.map +1 -1
- package/dist/integrations/github/issue-reconciler.js +4 -3
- package/dist/integrations/github/issue-reconciler.js.map +1 -1
- package/dist/integrations/github/rules.d.ts +6 -2
- package/dist/integrations/github/rules.d.ts.map +1 -1
- package/dist/integrations/github/rules.js +96 -15
- package/dist/integrations/github/rules.js.map +1 -1
- package/dist/integrations/github/sandbox.d.ts +6 -3
- package/dist/integrations/github/sandbox.d.ts.map +1 -1
- package/dist/integrations/github/sandbox.js +21 -2
- package/dist/integrations/github/sandbox.js.map +1 -1
- package/dist/integrations/issue-reconciler.d.ts +2 -0
- package/dist/integrations/issue-reconciler.d.ts.map +1 -1
- package/dist/integrations/issue-reconciler.js +1 -3
- package/dist/integrations/issue-reconciler.js.map +1 -1
- package/dist/integrations/linear/agent-tools.d.ts.map +1 -1
- package/dist/integrations/linear/agent-tools.js.map +1 -1
- package/dist/integrations/linear/default-rules.d.ts +2 -2
- package/dist/integrations/linear/default-rules.d.ts.map +1 -1
- package/dist/integrations/linear/default-rules.js +2 -2
- package/dist/integrations/linear/default-rules.js.map +1 -1
- package/dist/integrations/linear/integration.js +1 -0
- package/dist/integrations/linear/integration.js.map +1 -1
- package/dist/integrations/linear/issue-reconciler.d.ts.map +1 -1
- package/dist/integrations/linear/issue-reconciler.js +9 -4
- package/dist/integrations/linear/issue-reconciler.js.map +1 -1
- package/dist/integrations/linear/reconciliation-config.d.ts.map +1 -1
- package/dist/integrations/linear/reconciliation-config.js.map +1 -1
- package/dist/integrations/linear/routes.d.ts.map +1 -1
- package/dist/integrations/linear/routes.js +19 -26
- package/dist/integrations/linear/routes.js.map +1 -1
- package/dist/integrations/linear/rules.d.ts +7 -2
- package/dist/integrations/linear/rules.d.ts.map +1 -1
- package/dist/integrations/linear/rules.js +20 -8
- package/dist/integrations/linear/rules.js.map +1 -1
- package/dist/integrations/platform/api-client.d.ts.map +1 -1
- package/dist/integrations/platform/api-client.js +25 -4
- package/dist/integrations/platform/api-client.js.map +1 -1
- package/dist/integrations/platform/github/integration.d.ts +1 -0
- package/dist/integrations/platform/github/integration.d.ts.map +1 -1
- package/dist/integrations/platform/github/integration.js +5 -0
- package/dist/integrations/platform/github/integration.js.map +1 -1
- package/dist/integrations/platform/linear/integration.d.ts.map +1 -1
- package/dist/integrations/platform/linear/integration.js +5 -2
- package/dist/integrations/platform/linear/integration.js.map +1 -1
- package/dist/integrations/slack/emoji-shortcodes.generated.d.ts +8 -0
- package/dist/integrations/slack/emoji-shortcodes.generated.d.ts.map +1 -0
- package/dist/integrations/slack/emoji-shortcodes.generated.js +1985 -0
- package/dist/integrations/slack/emoji-shortcodes.generated.js.map +1 -0
- package/dist/integrations/slack/emoji.d.ts +3 -0
- package/dist/integrations/slack/emoji.d.ts.map +1 -0
- package/dist/integrations/slack/emoji.js +12 -0
- package/dist/integrations/slack/emoji.js.map +1 -0
- package/dist/integrations/slack/integration.js +1 -1
- package/dist/integrations/slack/integration.js.map +1 -1
- package/dist/integrations/slack/slack.d.ts.map +1 -1
- package/dist/integrations/slack/slack.js +16 -2
- package/dist/integrations/slack/slack.js.map +1 -1
- package/dist/routes/attention-activity.d.ts +2 -3
- package/dist/routes/attention-activity.d.ts.map +1 -1
- package/dist/routes/attention-activity.js +12 -3
- package/dist/routes/attention-activity.js.map +1 -1
- package/dist/routes/attention-parked.d.ts +22 -0
- package/dist/routes/attention-parked.d.ts.map +1 -0
- package/dist/routes/attention-parked.js +136 -0
- package/dist/routes/attention-parked.js.map +1 -0
- package/dist/routes/attention-providers.js +8 -8
- package/dist/routes/attention-providers.js.map +1 -1
- package/dist/routes/attention.d.ts +2 -0
- package/dist/routes/attention.d.ts.map +1 -1
- package/dist/routes/attention.js +47 -118
- package/dist/routes/attention.js.map +1 -1
- package/dist/routes/contracts.d.ts +627 -0
- package/dist/routes/contracts.d.ts.map +1 -0
- package/dist/routes/contracts.js +468 -0
- package/dist/routes/contracts.js.map +1 -0
- package/dist/routes/intake.d.ts +18 -0
- package/dist/routes/intake.d.ts.map +1 -1
- package/dist/routes/intake.js +265 -15
- package/dist/routes/intake.js.map +1 -1
- package/dist/routes/projects.d.ts.map +1 -1
- package/dist/routes/projects.js +26 -76
- package/dist/routes/projects.js.map +1 -1
- package/dist/routes/supervisor.d.ts +2 -0
- package/dist/routes/supervisor.d.ts.map +1 -1
- package/dist/routes/supervisor.js +7 -6
- package/dist/routes/supervisor.js.map +1 -1
- package/dist/routes/surface.d.ts +7 -4
- package/dist/routes/surface.d.ts.map +1 -1
- package/dist/routes/surface.js +17 -11
- package/dist/routes/surface.js.map +1 -1
- package/dist/routes/telemetry.d.ts +13 -0
- package/dist/routes/telemetry.d.ts.map +1 -0
- package/dist/routes/telemetry.js +60 -0
- package/dist/routes/telemetry.js.map +1 -0
- package/dist/routes/work-items.d.ts +3 -3
- package/dist/routes/work-items.d.ts.map +1 -1
- package/dist/routes/work-items.js +134 -250
- package/dist/routes/work-items.js.map +1 -1
- package/dist/rules/dispatch-errors.d.ts +2 -2
- package/dist/rules/dispatch-errors.d.ts.map +1 -1
- package/dist/rules/dispatch-errors.js +10 -6
- package/dist/rules/dispatch-errors.js.map +1 -1
- package/dist/rules/dispatcher.d.ts +9 -2
- package/dist/rules/dispatcher.d.ts.map +1 -1
- package/dist/rules/dispatcher.js +76 -23
- package/dist/rules/dispatcher.js.map +1 -1
- package/dist/rules/index.d.ts +4 -5
- package/dist/rules/index.d.ts.map +1 -1
- package/dist/rules/index.js +3 -4
- package/dist/rules/processor.d.ts +3 -3
- package/dist/rules/processor.d.ts.map +1 -1
- package/dist/rules/processor.js +24 -31
- package/dist/rules/processor.js.map +1 -1
- package/dist/rules/resolve.d.ts +1 -3
- package/dist/rules/resolve.d.ts.map +1 -1
- package/dist/rules/resolve.js +1 -4
- package/dist/rules/resolve.js.map +1 -1
- package/dist/rules/start-coordinator.d.ts.map +1 -1
- package/dist/rules/start-coordinator.js +3 -1
- package/dist/rules/start-coordinator.js.map +1 -1
- package/dist/rules/tools.d.ts.map +1 -1
- package/dist/rules/tools.js +20 -10
- package/dist/rules/tools.js.map +1 -1
- package/dist/rules/transition-service.d.ts +7 -7
- package/dist/rules/transition-service.d.ts.map +1 -1
- package/dist/rules/transition-service.js +21 -25
- package/dist/rules/transition-service.js.map +1 -1
- package/dist/rules/types.d.ts +16 -11
- package/dist/rules/types.d.ts.map +1 -1
- package/dist/rules/types.js.map +1 -1
- package/dist/rules/validation.d.ts +12 -2
- package/dist/rules/validation.d.ts.map +1 -1
- package/dist/rules/validation.js +29 -20
- package/dist/rules/validation.js.map +1 -1
- package/dist/session/live-sessions.d.ts +33 -3
- package/dist/session/live-sessions.d.ts.map +1 -1
- package/dist/session/live-sessions.js +67 -5
- package/dist/session/live-sessions.js.map +1 -1
- package/dist/storage/domains/intake/base.d.ts +54 -1
- package/dist/storage/domains/intake/base.d.ts.map +1 -1
- package/dist/storage/domains/intake/base.js +136 -4
- package/dist/storage/domains/intake/base.js.map +1 -1
- package/dist/storage/domains/work-items/base.d.ts +22 -7
- package/dist/storage/domains/work-items/base.d.ts.map +1 -1
- package/dist/storage/domains/work-items/base.js +41 -26
- package/dist/storage/domains/work-items/base.js.map +1 -1
- package/dist/supervisor/health-worker.d.ts +2 -0
- package/dist/supervisor/health-worker.d.ts.map +1 -1
- package/dist/supervisor/health-worker.js +3 -1
- package/dist/supervisor/health-worker.js.map +1 -1
- package/dist/supervisor/health.d.ts +12 -14
- package/dist/supervisor/health.d.ts.map +1 -1
- package/dist/supervisor/health.js +24 -52
- package/dist/supervisor/health.js.map +1 -1
- package/dist/supervisor/instructions.d.ts +1 -1
- package/dist/supervisor/instructions.d.ts.map +1 -1
- package/dist/supervisor/instructions.js +10 -8
- package/dist/supervisor/instructions.js.map +1 -1
- package/dist/supervisor/read-tools.d.ts +2 -0
- package/dist/supervisor/read-tools.d.ts.map +1 -1
- package/dist/supervisor/read-tools.js +2 -2
- package/dist/supervisor/read-tools.js.map +1 -1
- package/dist/supervisor/write-tools.d.ts.map +1 -1
- package/dist/supervisor/write-tools.js +6 -4
- package/dist/supervisor/write-tools.js.map +1 -1
- package/dist/telemetry-types.d.ts +7 -0
- package/dist/telemetry-types.d.ts.map +1 -0
- package/dist/telemetry-types.js +24 -0
- package/dist/telemetry-types.js.map +1 -0
- package/dist/telemetry.d.ts +9 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +47 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/work-item-branch.d.ts +2 -0
- package/dist/work-item-branch.d.ts.map +1 -1
- package/dist/work-item-branch.js +6 -1
- package/dist/work-item-branch.js.map +1 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +3 -1
- package/dist/workspace.js.map +1 -1
- package/factory-skills/configure-factory-rules/SKILL.md +30 -10
- package/package.json +12 -10
- package/dist/rules/defaults.d.ts +0 -9
- package/dist/rules/defaults.d.ts.map +0 -1
- package/dist/rules/defaults.js +0 -50
- package/dist/rules/defaults.js.map +0 -1
|
@@ -39,6 +39,11 @@ const INTAKE_SOURCE_BINDINGS_SCHEMA = {
|
|
|
39
39
|
integration_id: { type: "text" },
|
|
40
40
|
source_id: { type: "text" },
|
|
41
41
|
factory_project_id: { type: "text" },
|
|
42
|
+
/** Installed board the source feeds; `null` keeps the legacy source-type routing (issues → work, PRs → review). */
|
|
43
|
+
board: {
|
|
44
|
+
type: "text",
|
|
45
|
+
nullable: true
|
|
46
|
+
},
|
|
42
47
|
created_by_user_id: {
|
|
43
48
|
type: "text",
|
|
44
49
|
nullable: true
|
|
@@ -59,11 +64,73 @@ const INTAKE_SOURCE_BINDINGS_SCHEMA = {
|
|
|
59
64
|
]
|
|
60
65
|
}]
|
|
61
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* Routes items carrying a label to an installed board, per Factory project.
|
|
69
|
+
*
|
|
70
|
+
* Repository-scoped providers (GitHub) already know which project an item
|
|
71
|
+
* belongs to, but one repository can feed several boards: an issue labelled
|
|
72
|
+
* `release` belongs on a release board while the rest stay on Work. Labels
|
|
73
|
+
* without a route fall back to the provider's built-in board.
|
|
74
|
+
*/
|
|
75
|
+
const INTAKE_LABEL_ROUTES_SCHEMA = {
|
|
76
|
+
name: "intake_label_routes",
|
|
77
|
+
columns: {
|
|
78
|
+
id: { type: "uuid-pk" },
|
|
79
|
+
org_id: { type: "text" },
|
|
80
|
+
factory_project_id: { type: "text" },
|
|
81
|
+
integration_id: { type: "text" },
|
|
82
|
+
/** Label as the provider reports it; matched case-insensitively. */
|
|
83
|
+
label: { type: "text" },
|
|
84
|
+
board: { type: "text" },
|
|
85
|
+
created_by_user_id: {
|
|
86
|
+
type: "text",
|
|
87
|
+
nullable: true
|
|
88
|
+
},
|
|
89
|
+
created_at: { type: "timestamp" },
|
|
90
|
+
updated_at: { type: "timestamp" }
|
|
91
|
+
},
|
|
92
|
+
indexes: [{
|
|
93
|
+
name: "intake_label_routes_project_idx",
|
|
94
|
+
columns: ["org_id", "factory_project_id"]
|
|
95
|
+
}],
|
|
96
|
+
uniqueIndexes: [{
|
|
97
|
+
name: "intake_label_routes_org_project_integration_label_unique",
|
|
98
|
+
columns: [
|
|
99
|
+
"org_id",
|
|
100
|
+
"factory_project_id",
|
|
101
|
+
"integration_id",
|
|
102
|
+
"label"
|
|
103
|
+
]
|
|
104
|
+
}]
|
|
105
|
+
};
|
|
106
|
+
function toIntakeLabelRoute(row) {
|
|
107
|
+
return {
|
|
108
|
+
factoryProjectId: row.factory_project_id,
|
|
109
|
+
integrationId: row.integration_id,
|
|
110
|
+
label: row.label,
|
|
111
|
+
board: row.board
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/** Labels are matched the way GitHub treats them: case-insensitively. */
|
|
115
|
+
function normalizeIntakeLabel(label) {
|
|
116
|
+
return label.trim().toLowerCase();
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The board a labelled item should land on under `routes`, or `undefined` when
|
|
120
|
+
* none of its labels is routed. Ties resolve to the first route in `routes`
|
|
121
|
+
* order, so callers should pass a deterministically ordered list.
|
|
122
|
+
*/
|
|
123
|
+
function resolveIntakeLabelRoute(routes, labels) {
|
|
124
|
+
if (!labels?.length) return void 0;
|
|
125
|
+
const normalized = new Set(labels.map(normalizeIntakeLabel));
|
|
126
|
+
return routes.find((route) => normalized.has(normalizeIntakeLabel(route.label)));
|
|
127
|
+
}
|
|
62
128
|
function toIntakeSourceBinding(row) {
|
|
63
129
|
return {
|
|
64
130
|
integrationId: row.integration_id,
|
|
65
131
|
sourceId: row.source_id,
|
|
66
|
-
factoryProjectId: row.factory_project_id
|
|
132
|
+
factoryProjectId: row.factory_project_id,
|
|
133
|
+
board: row.board ?? null
|
|
67
134
|
};
|
|
68
135
|
}
|
|
69
136
|
var IntakeStorage = class extends FactoryStorageDomain {
|
|
@@ -71,11 +138,16 @@ var IntakeStorage = class extends FactoryStorageDomain {
|
|
|
71
138
|
super("intake");
|
|
72
139
|
}
|
|
73
140
|
async init() {
|
|
74
|
-
await this.ensureCollections([
|
|
141
|
+
await this.ensureCollections([
|
|
142
|
+
INTAKE_SETTINGS_SCHEMA,
|
|
143
|
+
INTAKE_SOURCE_BINDINGS_SCHEMA,
|
|
144
|
+
INTAKE_LABEL_ROUTES_SCHEMA
|
|
145
|
+
]);
|
|
75
146
|
}
|
|
76
147
|
async dangerouslyClearAll() {
|
|
77
148
|
await this.ops.deleteMany("intake_settings", {});
|
|
78
149
|
await this.ops.deleteMany("intake_source_bindings", {});
|
|
150
|
+
await this.ops.deleteMany("intake_label_routes", {});
|
|
79
151
|
}
|
|
80
152
|
get #db() {
|
|
81
153
|
return this.ops;
|
|
@@ -132,6 +204,15 @@ var IntakeStorage = class extends FactoryStorageDomain {
|
|
|
132
204
|
factory_project_id: factoryProjectId
|
|
133
205
|
})).map((row) => row.source_id);
|
|
134
206
|
}
|
|
207
|
+
/** The binding for one source, or `null` when it is unbound. */
|
|
208
|
+
async getBinding({ orgId, integrationId, sourceId }) {
|
|
209
|
+
const row = await this.#db.findOne("intake_source_bindings", {
|
|
210
|
+
org_id: orgId,
|
|
211
|
+
integration_id: integrationId,
|
|
212
|
+
source_id: sourceId
|
|
213
|
+
});
|
|
214
|
+
return row ? toIntakeSourceBinding(row) : null;
|
|
215
|
+
}
|
|
135
216
|
async clearBinding({ orgId, integrationId, sourceId }) {
|
|
136
217
|
const where = {
|
|
137
218
|
org_id: orgId,
|
|
@@ -145,7 +226,7 @@ var IntakeStorage = class extends FactoryStorageDomain {
|
|
|
145
226
|
return toIntakeSourceBinding(row);
|
|
146
227
|
}, { isolationLevel: "serializable" });
|
|
147
228
|
}
|
|
148
|
-
async setBinding({ orgId, integrationId, sourceId, factoryProjectId, userId }) {
|
|
229
|
+
async setBinding({ orgId, integrationId, sourceId, factoryProjectId, board = null, userId }) {
|
|
149
230
|
const where = {
|
|
150
231
|
org_id: orgId,
|
|
151
232
|
integration_id: integrationId,
|
|
@@ -154,6 +235,7 @@ var IntakeStorage = class extends FactoryStorageDomain {
|
|
|
154
235
|
const now = /* @__PURE__ */ new Date();
|
|
155
236
|
const patch = {
|
|
156
237
|
factory_project_id: factoryProjectId,
|
|
238
|
+
board,
|
|
157
239
|
updated_at: now
|
|
158
240
|
};
|
|
159
241
|
if (await this.#db.updateMany("intake_source_bindings", where, patch) > 0) return;
|
|
@@ -161,6 +243,7 @@ var IntakeStorage = class extends FactoryStorageDomain {
|
|
|
161
243
|
await this.#db.insertOne("intake_source_bindings", {
|
|
162
244
|
...where,
|
|
163
245
|
factory_project_id: factoryProjectId,
|
|
246
|
+
board,
|
|
164
247
|
created_by_user_id: userId ?? null,
|
|
165
248
|
created_at: now,
|
|
166
249
|
updated_at: now
|
|
@@ -170,8 +253,57 @@ var IntakeStorage = class extends FactoryStorageDomain {
|
|
|
170
253
|
await this.#db.updateMany("intake_source_bindings", where, patch);
|
|
171
254
|
}
|
|
172
255
|
}
|
|
256
|
+
/** Label routes in the org, optionally narrowed to one project and/or integration. Sorted by label. */
|
|
257
|
+
async listLabelRoutes({ orgId, factoryProjectId, integrationId }) {
|
|
258
|
+
return (await this.#db.findMany("intake_label_routes", {
|
|
259
|
+
org_id: orgId,
|
|
260
|
+
...factoryProjectId ? { factory_project_id: factoryProjectId } : {},
|
|
261
|
+
...integrationId ? { integration_id: integrationId } : {}
|
|
262
|
+
})).map(toIntakeLabelRoute).sort((a, b) => a.label.localeCompare(b.label));
|
|
263
|
+
}
|
|
264
|
+
async setLabelRoute({ orgId, factoryProjectId, integrationId, label, board, userId }) {
|
|
265
|
+
const where = {
|
|
266
|
+
org_id: orgId,
|
|
267
|
+
factory_project_id: factoryProjectId,
|
|
268
|
+
integration_id: integrationId,
|
|
269
|
+
label: normalizeIntakeLabel(label)
|
|
270
|
+
};
|
|
271
|
+
const now = /* @__PURE__ */ new Date();
|
|
272
|
+
const patch = {
|
|
273
|
+
board,
|
|
274
|
+
updated_at: now
|
|
275
|
+
};
|
|
276
|
+
if (await this.#db.updateMany("intake_label_routes", where, patch) > 0) return;
|
|
277
|
+
try {
|
|
278
|
+
await this.#db.insertOne("intake_label_routes", {
|
|
279
|
+
...where,
|
|
280
|
+
board,
|
|
281
|
+
created_by_user_id: userId ?? null,
|
|
282
|
+
created_at: now,
|
|
283
|
+
updated_at: now
|
|
284
|
+
});
|
|
285
|
+
} catch (error) {
|
|
286
|
+
if (!(error instanceof UniqueViolationError)) throw error;
|
|
287
|
+
await this.#db.updateMany("intake_label_routes", where, patch);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
/** Remove a label route; returns the route that was removed, or `null` when none existed. */
|
|
291
|
+
async clearLabelRoute({ orgId, factoryProjectId, integrationId, label }) {
|
|
292
|
+
const where = {
|
|
293
|
+
org_id: orgId,
|
|
294
|
+
factory_project_id: factoryProjectId,
|
|
295
|
+
integration_id: integrationId,
|
|
296
|
+
label: normalizeIntakeLabel(label)
|
|
297
|
+
};
|
|
298
|
+
return this.storage.withTransaction(async (ops) => {
|
|
299
|
+
const row = await ops.findOne("intake_label_routes", where);
|
|
300
|
+
if (!row) return null;
|
|
301
|
+
await ops.deleteMany("intake_label_routes", where);
|
|
302
|
+
return toIntakeLabelRoute(row);
|
|
303
|
+
}, { isolationLevel: "serializable" });
|
|
304
|
+
}
|
|
173
305
|
};
|
|
174
306
|
//#endregion
|
|
175
|
-
export { DEFAULT_INTAKE_CONFIG, INTAKE_SETTINGS_SCHEMA, INTAKE_SOURCE_BINDINGS_SCHEMA, IntakeStorage };
|
|
307
|
+
export { DEFAULT_INTAKE_CONFIG, INTAKE_LABEL_ROUTES_SCHEMA, INTAKE_SETTINGS_SCHEMA, INTAKE_SOURCE_BINDINGS_SCHEMA, IntakeStorage, normalizeIntakeLabel, resolveIntakeLabelRoute };
|
|
176
308
|
|
|
177
309
|
//# sourceMappingURL=base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","names":["#db"],"sources":["../../../../src/storage/domains/intake/base.ts"],"sourcesContent":["/**\n * Per-user intake selections for every configured intake integration.\n *\n * Integration ids are dynamic. Each integration contributes provider-neutral\n * sources through `FactoryIntegration.intake`; this domain only persists which\n * source ids the user selected.\n */\n\nimport { FactoryStorageDomain, UniqueViolationError } from '@mastra/core/storage';\nimport type { CollectionSchema, FactoryStorageOps } from '@mastra/core/storage';\n\nexport interface IntakeSelection {\n enabled: boolean;\n /** Provider-owned source ids; `null` means nothing is selected. */\n sourceIds: string[] | null;\n}\n\nexport type IntakeConfig = Record<string, IntakeSelection>;\n\nexport const DEFAULT_INTAKE_CONFIG: IntakeConfig = {};\n\nexport const INTAKE_SETTINGS_SCHEMA: CollectionSchema = {\n name: 'intake_settings',\n columns: {\n id: { type: 'uuid-pk' },\n org_id: { type: 'text' },\n user_id: { type: 'text' },\n config: { type: 'json' },\n created_at: { type: 'timestamp' },\n updated_at: { type: 'timestamp' },\n },\n uniqueIndexes: [{ name: 'intake_settings_org_user_unique', columns: ['org_id', 'user_id'] }],\n};\n\n/**\n * Binds an intake source to the Factory project its items belong to.\n *\n * Intake selections are per user and org-wide, so they cannot say *where* an\n * ingested item should land. GitHub items are naturally scoped by their linked\n * repository; providers without that link (Linear) need this explicit binding\n * so viewing one project's board cannot materialize another project's items.\n */\nexport const INTAKE_SOURCE_BINDINGS_SCHEMA: CollectionSchema = {\n name: 'intake_source_bindings',\n columns: {\n id: { type: 'uuid-pk' },\n org_id: { type: 'text' },\n integration_id: { type: 'text' },\n source_id: { type: 'text' },\n factory_project_id: { type: 'text' },\n created_by_user_id: { type: 'text', nullable: true },\n created_at: { type: 'timestamp' },\n updated_at: { type: 'timestamp' },\n },\n indexes: [{ name: 'intake_source_bindings_project_idx', columns: ['org_id', 'factory_project_id'] }],\n uniqueIndexes: [\n {\n name: 'intake_source_bindings_org_integration_source_unique',\n columns: ['org_id', 'integration_id', 'source_id'],\n },\n ],\n};\n\nexport interface IntakeSourceBinding {\n integrationId: string;\n sourceId: string;\n factoryProjectId: string;\n}\n\ntype IntakeSourceBindingRow = {\n integration_id: string;\n source_id: string;\n factory_project_id: string;\n};\nfunction toIntakeSourceBinding(row: IntakeSourceBindingRow): IntakeSourceBinding {\n return {\n integrationId: row.integration_id,\n sourceId: row.source_id,\n factoryProjectId: row.factory_project_id,\n };\n}\n\nexport class IntakeStorage extends FactoryStorageDomain {\n constructor() {\n super('intake');\n }\n\n async init(): Promise<void> {\n await this.ensureCollections([INTAKE_SETTINGS_SCHEMA, INTAKE_SOURCE_BINDINGS_SCHEMA]);\n }\n\n async dangerouslyClearAll(): Promise<void> {\n await this.ops.deleteMany('intake_settings', {});\n await this.ops.deleteMany('intake_source_bindings', {});\n }\n\n get #db(): FactoryStorageOps {\n return this.ops;\n }\n\n async getConfig({\n orgId,\n userId,\n integrationIds,\n }: {\n orgId: string;\n userId: string;\n /**\n * When provided, the result contains exactly these integration ids, with\n * unset integrations defaulting to `{ enabled: true, sourceIds: null }`.\n */\n integrationIds?: string[];\n }): Promise<IntakeConfig> {\n const row = await this.#db.findOne<{ config: IntakeConfig }>('intake_settings', {\n org_id: orgId,\n user_id: userId,\n });\n const saved = structuredClone(row?.config ?? DEFAULT_INTAKE_CONFIG);\n if (!integrationIds) return saved;\n return Object.fromEntries(\n integrationIds.map(integrationId => [integrationId, saved[integrationId] ?? { enabled: true, sourceIds: null }]),\n );\n }\n\n async saveConfig({ orgId, userId, config }: { orgId: string; userId: string; config: IntakeConfig }): Promise<void> {\n const now = new Date();\n const where = { org_id: orgId, user_id: userId };\n const updated = await this.#db.updateMany('intake_settings', where, { config, updated_at: now });\n if (updated > 0) return;\n try {\n await this.#db.insertOne('intake_settings', { ...where, config, created_at: now, updated_at: now });\n } catch (error) {\n if (!(error instanceof UniqueViolationError)) throw error;\n await this.#db.updateMany('intake_settings', where, { config, updated_at: now });\n }\n }\n\n /** Every source binding in the org, optionally narrowed to one integration. */\n async listBindings({\n orgId,\n integrationId,\n }: {\n orgId: string;\n integrationId?: string;\n }): Promise<IntakeSourceBinding[]> {\n const rows = await this.#db.findMany<IntakeSourceBindingRow>('intake_source_bindings', {\n org_id: orgId,\n ...(integrationId ? { integration_id: integrationId } : {}),\n });\n return rows.map(toIntakeSourceBinding);\n }\n\n /** Source ids bound to one Factory project. Empty means \"nothing bound\". */\n async listBoundSourceIds({\n orgId,\n integrationId,\n factoryProjectId,\n }: {\n orgId: string;\n integrationId: string;\n factoryProjectId: string;\n }): Promise<string[]> {\n const rows = await this.#db.findMany<IntakeSourceBindingRow>('intake_source_bindings', {\n org_id: orgId,\n integration_id: integrationId,\n factory_project_id: factoryProjectId,\n });\n return rows.map(row => row.source_id);\n }\n\n async clearBinding({\n orgId,\n integrationId,\n sourceId,\n }: {\n orgId: string;\n integrationId: string;\n sourceId: string;\n }): Promise<IntakeSourceBinding | null> {\n const where = { org_id: orgId, integration_id: integrationId, source_id: sourceId };\n return this.storage.withTransaction(\n async ops => {\n const row = await ops.findOne<IntakeSourceBindingRow>('intake_source_bindings', where);\n if (!row) return null;\n await ops.deleteMany('intake_source_bindings', where);\n return toIntakeSourceBinding(row);\n },\n { isolationLevel: 'serializable' },\n );\n }\n\n async setBinding({\n orgId,\n integrationId,\n sourceId,\n factoryProjectId,\n userId,\n }: {\n orgId: string;\n integrationId: string;\n sourceId: string;\n factoryProjectId: string;\n userId?: string;\n }): Promise<void> {\n const where = { org_id: orgId, integration_id: integrationId, source_id: sourceId };\n const now = new Date();\n const patch = { factory_project_id: factoryProjectId, updated_at: now };\n const updated = await this.#db.updateMany('intake_source_bindings', where, patch);\n if (updated > 0) return;\n try {\n await this.#db.insertOne('intake_source_bindings', {\n ...where,\n factory_project_id: factoryProjectId,\n created_by_user_id: userId ?? null,\n created_at: now,\n updated_at: now,\n });\n } catch (error) {\n if (!(error instanceof UniqueViolationError)) throw error;\n await this.#db.updateMany('intake_source_bindings', where, patch);\n }\n }\n}\n"],"mappings":";;;;;;;;;AAmBA,MAAa,wBAAsC,CAAC;AAEpD,MAAa,yBAA2C;CACtD,MAAM;CACN,SAAS;EACP,IAAI,EAAE,MAAM,UAAU;EACtB,QAAQ,EAAE,MAAM,OAAO;EACvB,SAAS,EAAE,MAAM,OAAO;EACxB,QAAQ,EAAE,MAAM,OAAO;EACvB,YAAY,EAAE,MAAM,YAAY;EAChC,YAAY,EAAE,MAAM,YAAY;CAClC;CACA,eAAe,CAAC;EAAE,MAAM;EAAmC,SAAS,CAAC,UAAU,SAAS;CAAE,CAAC;AAC7F;;;;;;;;;AAUA,MAAa,gCAAkD;CAC7D,MAAM;CACN,SAAS;EACP,IAAI,EAAE,MAAM,UAAU;EACtB,QAAQ,EAAE,MAAM,OAAO;EACvB,gBAAgB,EAAE,MAAM,OAAO;EAC/B,WAAW,EAAE,MAAM,OAAO;EAC1B,oBAAoB,EAAE,MAAM,OAAO;EACnC,oBAAoB;GAAE,MAAM;GAAQ,UAAU;EAAK;EACnD,YAAY,EAAE,MAAM,YAAY;EAChC,YAAY,EAAE,MAAM,YAAY;CAClC;CACA,SAAS,CAAC;EAAE,MAAM;EA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IACZ,YAAY;GACd,CAAC;EACH,SAAS,OAAO;GACd,IAAI,EAAE,iBAAiB,uBAAuB,MAAM;GACpD,MAAM,KAAKA,IAAI,WAAW,0BAA0B,OAAO,KAAK;EAClE;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"base.js","names":["#db"],"sources":["../../../../src/storage/domains/intake/base.ts"],"sourcesContent":["/**\n * Per-user intake selections for every configured intake integration.\n *\n * Integration ids are dynamic. Each integration contributes provider-neutral\n * sources through `FactoryIntegration.intake`; this domain only persists which\n * source ids the user selected.\n */\n\nimport { FactoryStorageDomain, UniqueViolationError } from '@mastra/core/storage';\nimport type { CollectionSchema, FactoryStorageOps } from '@mastra/core/storage';\n\nexport interface IntakeSelection {\n enabled: boolean;\n /** Provider-owned source ids; `null` means nothing is selected. */\n sourceIds: string[] | null;\n}\n\nexport type IntakeConfig = Record<string, IntakeSelection>;\n\nexport const DEFAULT_INTAKE_CONFIG: IntakeConfig = {};\n\nexport const INTAKE_SETTINGS_SCHEMA: CollectionSchema = {\n name: 'intake_settings',\n columns: {\n id: { type: 'uuid-pk' },\n org_id: { type: 'text' },\n user_id: { type: 'text' },\n config: { type: 'json' },\n created_at: { type: 'timestamp' },\n updated_at: { type: 'timestamp' },\n },\n uniqueIndexes: [{ name: 'intake_settings_org_user_unique', columns: ['org_id', 'user_id'] }],\n};\n\n/**\n * Binds an intake source to the Factory project its items belong to.\n *\n * Intake selections are per user and org-wide, so they cannot say *where* an\n * ingested item should land. GitHub items are naturally scoped by their linked\n * repository; providers without that link (Linear) need this explicit binding\n * so viewing one project's board cannot materialize another project's items.\n */\nexport const INTAKE_SOURCE_BINDINGS_SCHEMA: CollectionSchema = {\n name: 'intake_source_bindings',\n columns: {\n id: { type: 'uuid-pk' },\n org_id: { type: 'text' },\n integration_id: { type: 'text' },\n source_id: { type: 'text' },\n factory_project_id: { type: 'text' },\n /** Installed board the source feeds; `null` keeps the legacy source-type routing (issues → work, PRs → review). */\n board: { type: 'text', nullable: true },\n created_by_user_id: { type: 'text', nullable: true },\n created_at: { type: 'timestamp' },\n updated_at: { type: 'timestamp' },\n },\n indexes: [{ name: 'intake_source_bindings_project_idx', columns: ['org_id', 'factory_project_id'] }],\n uniqueIndexes: [\n {\n name: 'intake_source_bindings_org_integration_source_unique',\n columns: ['org_id', 'integration_id', 'source_id'],\n },\n ],\n};\n\nexport interface IntakeSourceBinding {\n integrationId: string;\n sourceId: string;\n factoryProjectId: string;\n /** Installed board the source feeds, or `null` for legacy source-type routing. */\n board: string | null;\n}\n\n/**\n * Routes items carrying a label to an installed board, per Factory project.\n *\n * Repository-scoped providers (GitHub) already know which project an item\n * belongs to, but one repository can feed several boards: an issue labelled\n * `release` belongs on a release board while the rest stay on Work. Labels\n * without a route fall back to the provider's built-in board.\n */\nexport const INTAKE_LABEL_ROUTES_SCHEMA: CollectionSchema = {\n name: 'intake_label_routes',\n columns: {\n id: { type: 'uuid-pk' },\n org_id: { type: 'text' },\n factory_project_id: { type: 'text' },\n integration_id: { type: 'text' },\n /** Label as the provider reports it; matched case-insensitively. */\n label: { type: 'text' },\n board: { type: 'text' },\n created_by_user_id: { type: 'text', nullable: true },\n created_at: { type: 'timestamp' },\n updated_at: { type: 'timestamp' },\n },\n indexes: [{ name: 'intake_label_routes_project_idx', columns: ['org_id', 'factory_project_id'] }],\n uniqueIndexes: [\n {\n name: 'intake_label_routes_org_project_integration_label_unique',\n columns: ['org_id', 'factory_project_id', 'integration_id', 'label'],\n },\n ],\n};\n\nexport interface IntakeLabelRoute {\n factoryProjectId: string;\n integrationId: string;\n label: string;\n board: string;\n}\n\ntype IntakeLabelRouteRow = {\n factory_project_id: string;\n integration_id: string;\n label: string;\n board: string;\n};\nfunction toIntakeLabelRoute(row: IntakeLabelRouteRow): IntakeLabelRoute {\n return {\n factoryProjectId: row.factory_project_id,\n integrationId: row.integration_id,\n label: row.label,\n board: row.board,\n };\n}\n\n/** Labels are matched the way GitHub treats them: case-insensitively. */\nexport function normalizeIntakeLabel(label: string): string {\n return label.trim().toLowerCase();\n}\n\n/**\n * The board a labelled item should land on under `routes`, or `undefined` when\n * none of its labels is routed. Ties resolve to the first route in `routes`\n * order, so callers should pass a deterministically ordered list.\n */\nexport function resolveIntakeLabelRoute(\n routes: readonly IntakeLabelRoute[],\n labels: readonly string[] | undefined,\n): IntakeLabelRoute | undefined {\n if (!labels?.length) return undefined;\n const normalized = new Set(labels.map(normalizeIntakeLabel));\n return routes.find(route => normalized.has(normalizeIntakeLabel(route.label)));\n}\n\ntype IntakeSourceBindingRow = {\n integration_id: string;\n source_id: string;\n factory_project_id: string;\n board?: string | null;\n};\nfunction toIntakeSourceBinding(row: IntakeSourceBindingRow): IntakeSourceBinding {\n return {\n integrationId: row.integration_id,\n sourceId: row.source_id,\n factoryProjectId: row.factory_project_id,\n board: row.board ?? null,\n };\n}\n\nexport class IntakeStorage extends FactoryStorageDomain {\n constructor() {\n super('intake');\n }\n\n async init(): Promise<void> {\n await this.ensureCollections([INTAKE_SETTINGS_SCHEMA, INTAKE_SOURCE_BINDINGS_SCHEMA, INTAKE_LABEL_ROUTES_SCHEMA]);\n }\n\n async dangerouslyClearAll(): Promise<void> {\n await this.ops.deleteMany('intake_settings', {});\n await this.ops.deleteMany('intake_source_bindings', {});\n await this.ops.deleteMany('intake_label_routes', {});\n }\n\n get #db(): FactoryStorageOps {\n return this.ops;\n }\n\n async getConfig({\n orgId,\n userId,\n integrationIds,\n }: {\n orgId: string;\n userId: string;\n /**\n * When provided, the result contains exactly these integration ids, with\n * unset integrations defaulting to `{ enabled: true, sourceIds: null }`.\n */\n integrationIds?: string[];\n }): Promise<IntakeConfig> {\n const row = await this.#db.findOne<{ config: IntakeConfig }>('intake_settings', {\n org_id: orgId,\n user_id: userId,\n });\n const saved = structuredClone(row?.config ?? DEFAULT_INTAKE_CONFIG);\n if (!integrationIds) return saved;\n return Object.fromEntries(\n integrationIds.map(integrationId => [integrationId, saved[integrationId] ?? { enabled: true, sourceIds: null }]),\n );\n }\n\n async saveConfig({ orgId, userId, config }: { orgId: string; userId: string; config: IntakeConfig }): Promise<void> {\n const now = new Date();\n const where = { org_id: orgId, user_id: userId };\n const updated = await this.#db.updateMany('intake_settings', where, { config, updated_at: now });\n if (updated > 0) return;\n try {\n await this.#db.insertOne('intake_settings', { ...where, config, created_at: now, updated_at: now });\n } catch (error) {\n if (!(error instanceof UniqueViolationError)) throw error;\n await this.#db.updateMany('intake_settings', where, { config, updated_at: now });\n }\n }\n\n /** Every source binding in the org, optionally narrowed to one integration. */\n async listBindings({\n orgId,\n integrationId,\n }: {\n orgId: string;\n integrationId?: string;\n }): Promise<IntakeSourceBinding[]> {\n const rows = await this.#db.findMany<IntakeSourceBindingRow>('intake_source_bindings', {\n org_id: orgId,\n ...(integrationId ? { integration_id: integrationId } : {}),\n });\n return rows.map(toIntakeSourceBinding);\n }\n\n /** Source ids bound to one Factory project. Empty means \"nothing bound\". */\n async listBoundSourceIds({\n orgId,\n integrationId,\n factoryProjectId,\n }: {\n orgId: string;\n integrationId: string;\n factoryProjectId: string;\n }): Promise<string[]> {\n const rows = await this.#db.findMany<IntakeSourceBindingRow>('intake_source_bindings', {\n org_id: orgId,\n integration_id: integrationId,\n factory_project_id: factoryProjectId,\n });\n return rows.map(row => row.source_id);\n }\n\n /** The binding for one source, or `null` when it is unbound. */\n async getBinding({\n orgId,\n integrationId,\n sourceId,\n }: {\n orgId: string;\n integrationId: string;\n sourceId: string;\n }): Promise<IntakeSourceBinding | null> {\n const row = await this.#db.findOne<IntakeSourceBindingRow>('intake_source_bindings', {\n org_id: orgId,\n integration_id: integrationId,\n source_id: sourceId,\n });\n return row ? toIntakeSourceBinding(row) : null;\n }\n\n async clearBinding({\n orgId,\n integrationId,\n sourceId,\n }: {\n orgId: string;\n integrationId: string;\n sourceId: string;\n }): Promise<IntakeSourceBinding | null> {\n const where = { org_id: orgId, integration_id: integrationId, source_id: sourceId };\n return this.storage.withTransaction(\n async ops => {\n const row = await ops.findOne<IntakeSourceBindingRow>('intake_source_bindings', where);\n if (!row) return null;\n await ops.deleteMany('intake_source_bindings', where);\n return toIntakeSourceBinding(row);\n },\n { isolationLevel: 'serializable' },\n );\n }\n\n async setBinding({\n orgId,\n integrationId,\n sourceId,\n factoryProjectId,\n board = null,\n userId,\n }: {\n orgId: string;\n integrationId: string;\n sourceId: string;\n factoryProjectId: string;\n board?: string | null;\n userId?: string;\n }): Promise<void> {\n const where = { org_id: orgId, integration_id: integrationId, source_id: sourceId };\n const now = new Date();\n const patch = { factory_project_id: factoryProjectId, board, updated_at: now };\n const updated = await this.#db.updateMany('intake_source_bindings', where, patch);\n if (updated > 0) return;\n try {\n await this.#db.insertOne('intake_source_bindings', {\n ...where,\n factory_project_id: factoryProjectId,\n board,\n created_by_user_id: userId ?? null,\n created_at: now,\n updated_at: now,\n });\n } catch (error) {\n if (!(error instanceof UniqueViolationError)) throw error;\n await this.#db.updateMany('intake_source_bindings', where, patch);\n }\n }\n\n /** Label routes in the org, optionally narrowed to one project and/or integration. Sorted by label. */\n async listLabelRoutes({\n orgId,\n factoryProjectId,\n integrationId,\n }: {\n orgId: string;\n factoryProjectId?: string;\n integrationId?: string;\n }): Promise<IntakeLabelRoute[]> {\n const rows = await this.#db.findMany<IntakeLabelRouteRow>('intake_label_routes', {\n org_id: orgId,\n ...(factoryProjectId ? { factory_project_id: factoryProjectId } : {}),\n ...(integrationId ? { integration_id: integrationId } : {}),\n });\n return rows.map(toIntakeLabelRoute).sort((a, b) => a.label.localeCompare(b.label));\n }\n\n async setLabelRoute({\n orgId,\n factoryProjectId,\n integrationId,\n label,\n board,\n userId,\n }: {\n orgId: string;\n factoryProjectId: string;\n integrationId: string;\n label: string;\n board: string;\n userId?: string;\n }): Promise<void> {\n const where = {\n org_id: orgId,\n factory_project_id: factoryProjectId,\n integration_id: integrationId,\n label: normalizeIntakeLabel(label),\n };\n const now = new Date();\n const patch = { board, updated_at: now };\n const updated = await this.#db.updateMany('intake_label_routes', where, patch);\n if (updated > 0) return;\n try {\n await this.#db.insertOne('intake_label_routes', {\n ...where,\n board,\n created_by_user_id: userId ?? null,\n created_at: now,\n updated_at: now,\n });\n } catch (error) {\n if (!(error instanceof UniqueViolationError)) throw error;\n await this.#db.updateMany('intake_label_routes', where, patch);\n }\n }\n\n /** Remove a label route; returns the route that was removed, or `null` when none existed. */\n async clearLabelRoute({\n orgId,\n factoryProjectId,\n integrationId,\n label,\n }: {\n orgId: string;\n factoryProjectId: string;\n integrationId: string;\n label: string;\n }): Promise<IntakeLabelRoute | null> {\n const where = {\n org_id: orgId,\n factory_project_id: factoryProjectId,\n integration_id: integrationId,\n label: normalizeIntakeLabel(label),\n };\n return this.storage.withTransaction(\n async ops => {\n const row = await ops.findOne<IntakeLabelRouteRow>('intake_label_routes', where);\n if (!row) return null;\n await ops.deleteMany('intake_label_routes', where);\n return toIntakeLabelRoute(row);\n },\n { isolationLevel: 'serializable' },\n );\n }\n}\n"],"mappings":";;;;;;;;;AAmBA,MAAa,wBAAsC,CAAC;AAEpD,MAAa,yBAA2C;CACtD,MAAM;CACN,SAAS;EACP,IAAI,EAAE,MAAM,UAAU;EACtB,QAAQ,EAAE,MAAM,OAAO;EACvB,SAAS,EAAE,MAAM,OAAO;EACxB,QAAQ,EAAE,MAAM,OAAO;EACvB,YAAY,EAAE,MAAM,YAAY;EAChC,YAAY,EAAE,MAAM,YAAY;CAClC;CACA,eAAe,CAAC;EAAE,MAAM;EAAmC,SAAS,CAAC,UAAU,SAAS;CAAE,CAAC;AAC7F;;;;;;;;;AAUA,MAAa,gCAAkD;CAC7D,MAAM;CACN,SAAS;EACP,IAAI,EAAE,MAAM,UAAU;EACtB,QAAQ,EAAE,MAAM,OAAO;EACvB,gBAAgB,EAAE,MAAM,OAAO;EAC/B,WAAW,EAAE,MAAM,OAAO;EAC1B,oBAAoB,EAAE,MAAM,OAAO;;EAEnC,OAAO;GAAE,MAAM;GAAQ,UAAU;EAAK;EACtC,oBAAoB;GAAE,MAAM;GAAQ,UAAU;EAAK;EACnD,YAA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ACnC;EACA,OAAO,KAAK,QAAQ,gBAClB,OAAM,QAAO;GACX,MAAM,MAAM,MAAM,IAAI,QAA6B,uBAAuB,KAAK;GAC/E,IAAI,CAAC,KAAK,OAAO;GACjB,MAAM,IAAI,WAAW,uBAAuB,KAAK;GACjD,OAAO,mBAAmB,GAAG;EAC/B,GACA,EAAE,gBAAgB,eAAe,CACnC;CACF;AACF"}
|
|
@@ -74,7 +74,7 @@ export interface CommitFactoryRuleEvaluationInput {
|
|
|
74
74
|
identity: string;
|
|
75
75
|
triggerType: string;
|
|
76
76
|
};
|
|
77
|
-
|
|
77
|
+
configVersion: string;
|
|
78
78
|
expectedRevision: number | null;
|
|
79
79
|
actor: Record<string, unknown> | null;
|
|
80
80
|
outcome: {
|
|
@@ -110,7 +110,7 @@ export interface FactoryRuleEvaluationRecord {
|
|
|
110
110
|
id: string;
|
|
111
111
|
ingressId: string;
|
|
112
112
|
workItemId: string | null;
|
|
113
|
-
|
|
113
|
+
configVersion: string;
|
|
114
114
|
expectedRevision: number | null;
|
|
115
115
|
outcome: 'accepted' | 'rejected';
|
|
116
116
|
code: string | null;
|
|
@@ -123,8 +123,10 @@ export interface FactoryRuleEvaluationRecord {
|
|
|
123
123
|
}
|
|
124
124
|
/** `proposed` is parked awaiting approval; `dismissed` is human, `superseded` is automatic. */
|
|
125
125
|
export type FactoryDispatchStatus = 'pending' | 'proposed' | 'dismissed' | 'superseded' | 'leased' | 'retry' | 'succeeded' | 'failed';
|
|
126
|
-
declare const FACTORY_DISPATCH_FAILURE_CODES: readonly ["session_unavailable", "source_control_missing", "source_repository_missing", "unsupported_provider_item", "notification_delivery_failed", "
|
|
126
|
+
declare const FACTORY_DISPATCH_FAILURE_CODES: readonly ["session_unavailable", "source_control_missing", "source_repository_missing", "unsupported_provider_item", "notification_delivery_failed", "run_overdue", "repository_git_missing", "repository_egress_blocked", "repository_clone_failed", "repository_pull_failed", "repository_push_failed", "repository_commit_failed", "repository_cli_missing", "repository_pr_failed", "unknown"];
|
|
127
|
+
declare const STORED_FACTORY_DISPATCH_FAILURE_CODES: readonly ["session_unavailable", "source_control_missing", "source_repository_missing", "unsupported_provider_item", "notification_delivery_failed", "run_overdue", "repository_git_missing", "repository_egress_blocked", "repository_clone_failed", "repository_pull_failed", "repository_push_failed", "repository_commit_failed", "repository_cli_missing", "repository_pr_failed", "unknown", "plan_awaiting_approval", "run_awaiting_input"];
|
|
127
128
|
export type FactoryDispatchFailureCode = (typeof FACTORY_DISPATCH_FAILURE_CODES)[number];
|
|
129
|
+
export type StoredFactoryDispatchFailureCode = (typeof STORED_FACTORY_DISPATCH_FAILURE_CODES)[number];
|
|
128
130
|
export interface FactoryDeferredDecisionPageInput {
|
|
129
131
|
orgId: string;
|
|
130
132
|
factoryProjectId: string;
|
|
@@ -172,7 +174,7 @@ export interface FactoryDeferredDecisionRecord {
|
|
|
172
174
|
leaseOwner: string | null;
|
|
173
175
|
leaseExpiresAt: Date | null;
|
|
174
176
|
lastError: string | null;
|
|
175
|
-
failureCode:
|
|
177
|
+
failureCode: StoredFactoryDispatchFailureCode | null;
|
|
176
178
|
/** When a human released this run; set once, so the gate never parks it again. */
|
|
177
179
|
approvedAt: Date | null;
|
|
178
180
|
/** Who released this run — the run is attributed to them, not the repo connector. */
|
|
@@ -181,7 +183,7 @@ export interface FactoryDeferredDecisionRecord {
|
|
|
181
183
|
createdAt: Date;
|
|
182
184
|
updatedAt: Date;
|
|
183
185
|
}
|
|
184
|
-
export type FactoryAttentionKind = 'automation-failed' | 'automation-proposed' | 'mention' | 'activity' | 'supervisor-finding';
|
|
186
|
+
export type FactoryAttentionKind = 'automation-failed' | 'automation-proposed' | 'mention' | 'activity' | 'supervisor-finding' | 'agent-waiting';
|
|
185
187
|
export type FactoryAttentionReceiptState = 'read' | 'archived';
|
|
186
188
|
export interface FactorySupervisorFindingRecord {
|
|
187
189
|
id: string;
|
|
@@ -225,6 +227,8 @@ export declare function factoryMentionAttentionIdentity(commentId: string): Fact
|
|
|
225
227
|
/** Collapsed per work item, so the occurrence is what a new comment bumps. */
|
|
226
228
|
export declare function factoryActivityAttentionIdentity(workItemId: string, occurrence: number): FactoryAttentionIdentity;
|
|
227
229
|
export declare function factorySupervisorFindingAttentionIdentity(findingKey: string, occurrence: number): FactoryAttentionIdentity;
|
|
230
|
+
/** Dated by the park itself, so an answer and a new park never share a receipt. */
|
|
231
|
+
export declare function factoryAgentWaitingAttentionIdentity(sessionId: string, suspendedAt: number): FactoryAttentionIdentity;
|
|
228
232
|
export declare function factoryAttentionKey(factoryProjectId: string, identity: FactoryAttentionIdentity): string;
|
|
229
233
|
export interface FactoryRunBindingSessionAddress {
|
|
230
234
|
factoryProjectId: string;
|
|
@@ -279,7 +283,7 @@ export interface FactoryPendingStartRecord {
|
|
|
279
283
|
leaseOwner: string | null;
|
|
280
284
|
leaseExpiresAt: Date | null;
|
|
281
285
|
lastError: string | null;
|
|
282
|
-
failureCode:
|
|
286
|
+
failureCode: StoredFactoryDispatchFailureCode | null;
|
|
283
287
|
completedAt: Date | null;
|
|
284
288
|
createdAt: Date;
|
|
285
289
|
updatedAt: Date;
|
|
@@ -316,7 +320,7 @@ export interface CommitFactoryTransitionInput {
|
|
|
316
320
|
triggerType: string;
|
|
317
321
|
transitionId: string;
|
|
318
322
|
};
|
|
319
|
-
|
|
323
|
+
configVersion: string;
|
|
320
324
|
causalChain: Array<{
|
|
321
325
|
ingressId: string;
|
|
322
326
|
decisionType: string;
|
|
@@ -482,6 +486,12 @@ export declare class WorkItemsStorage extends FactoryStorageDomain {
|
|
|
482
486
|
* has to remember, since clients stop polling while their stream is up.
|
|
483
487
|
*/
|
|
484
488
|
onAttentionChanged(listener: (scope: FactoryAttentionScope) => void): void;
|
|
489
|
+
/**
|
|
490
|
+
* Wired once at boot, before `init()`. Tells the legacy attention sweep and
|
|
491
|
+
* the stale-binding sweep which cards sit in a phase their installed board
|
|
492
|
+
* declares terminal.
|
|
493
|
+
*/
|
|
494
|
+
useTerminalPhasePredicate(isTerminal: (item: WorkItemRow) => boolean): void;
|
|
485
495
|
init(): Promise<void>;
|
|
486
496
|
dangerouslyClearAll(): Promise<void>;
|
|
487
497
|
syncSupervisorFindings(input: {
|
|
@@ -529,6 +539,11 @@ export declare class WorkItemsStorage extends FactoryStorageDomain {
|
|
|
529
539
|
orgId: string;
|
|
530
540
|
sessionId: string;
|
|
531
541
|
}): Promise<number>;
|
|
542
|
+
getByProjectSource({ orgId, factoryProjectId, source, }: {
|
|
543
|
+
orgId: string;
|
|
544
|
+
factoryProjectId: string;
|
|
545
|
+
source: ExternalWorkItemSource;
|
|
546
|
+
}): Promise<WorkItemRow | null>;
|
|
532
547
|
get({ orgId, id }: {
|
|
533
548
|
orgId: string;
|
|
534
549
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/work-items/base.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,oBAAoB,EAAwB,MAAM,sBAAsB,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAsC,MAAM,sBAAsB,CAAC;AAEjG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAO1E,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAanC,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAE7E;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,4FAA4F;AAC5F,eAAO,MAAM,gCAAgC,kCAAkC,CAAC;AAChF,eAA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QACd,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,gBAAgB,EAAE,MAAM,CAAC;KAC1B,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAkBzB,MAAM,CAAC,EACX,KAAK,EACL,EAAE,EACF,MAAM,EACN,KAAK,EACL,gBAAgB,EAChB,aAAa,GACd,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,mBAAmB,CAAC;QAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,QAAQ,EAAE,kBAAkB,CAAA;KAAE,GAAG,IAAI,CAAC;IAiHjE,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;CA2BxF"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { isTerminalFactoryRuleStage } from "../../../rules/types.js";
|
|
2
1
|
import { WORK_ITEM_ACTIVITY_SCHEMA, WORK_ITEM_COMMENTS_SCHEMA, WORK_ITEM_COMMENT_MENTIONS_SCHEMA } from "../comments/schema.js";
|
|
3
2
|
import { createHash } from "crypto";
|
|
4
3
|
import { FactoryStorageDomain, UniqueViolationError } from "@mastra/core/storage";
|
|
@@ -43,8 +42,7 @@ const FACTORY_DISPATCH_FAILURE_CODES = [
|
|
|
43
42
|
"source_repository_missing",
|
|
44
43
|
"unsupported_provider_item",
|
|
45
44
|
"notification_delivery_failed",
|
|
46
|
-
"
|
|
47
|
-
"run_awaiting_input",
|
|
45
|
+
"run_overdue",
|
|
48
46
|
"repository_git_missing",
|
|
49
47
|
"repository_egress_blocked",
|
|
50
48
|
"repository_clone_failed",
|
|
@@ -55,8 +53,11 @@ const FACTORY_DISPATCH_FAILURE_CODES = [
|
|
|
55
53
|
"repository_pr_failed",
|
|
56
54
|
"unknown"
|
|
57
55
|
];
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
/** Written until a pause stopped counting as a failure; stored rows still read through them. */
|
|
57
|
+
const RETIRED_FACTORY_DISPATCH_FAILURE_CODES = ["plan_awaiting_approval", "run_awaiting_input"];
|
|
58
|
+
const STORED_FACTORY_DISPATCH_FAILURE_CODES = [...FACTORY_DISPATCH_FAILURE_CODES, ...RETIRED_FACTORY_DISPATCH_FAILURE_CODES];
|
|
59
|
+
function isStoredFactoryDispatchFailureCode(value) {
|
|
60
|
+
return STORED_FACTORY_DISPATCH_FAILURE_CODES.some((code) => code === value);
|
|
60
61
|
}
|
|
61
62
|
function factoryDecisionAttentionIdentity(decisionId, failureOccurrence) {
|
|
62
63
|
return {
|
|
@@ -104,21 +105,17 @@ function factorySupervisorFindingAttentionIdentity(findingKey, occurrence) {
|
|
|
104
105
|
occurrence
|
|
105
106
|
};
|
|
106
107
|
}
|
|
108
|
+
/** Dated by the park itself, so an answer and a new park never share a receipt. */
|
|
109
|
+
function factoryAgentWaitingAttentionIdentity(sessionId, suspendedAt) {
|
|
110
|
+
return {
|
|
111
|
+
kind: "agent-waiting",
|
|
112
|
+
sourceId: sessionId,
|
|
113
|
+
occurrence: suspendedAt
|
|
114
|
+
};
|
|
115
|
+
}
|
|
107
116
|
function factoryAttentionKey(factoryProjectId, identity) {
|
|
108
117
|
return `factory:${factoryProjectId}:attention:${identity.kind}:${identity.sourceId}:${identity.occurrence}`;
|
|
109
118
|
}
|
|
110
|
-
/**
|
|
111
|
-
* Stages in which a bound run can still act on its work item. Mirrors the
|
|
112
|
-
* non-terminal subset of `FACTORY_RULE_STAGES` (rules/types.ts); bindings for
|
|
113
|
-
* items outside these stages are dead weight in the reconcile walk.
|
|
114
|
-
*/
|
|
115
|
-
const ACTIVE_RUN_BINDING_STAGES = /* @__PURE__ */ new Set([
|
|
116
|
-
"intake",
|
|
117
|
-
"triage",
|
|
118
|
-
"planning",
|
|
119
|
-
"execute",
|
|
120
|
-
"review"
|
|
121
|
-
]);
|
|
122
119
|
const WORK_ITEMS_SCHEMA = {
|
|
123
120
|
name: "work_items",
|
|
124
121
|
columns: {
|
|
@@ -574,7 +571,7 @@ const FACTORY_GOVERNANCE_SCHEMAS = [
|
|
|
574
571
|
user_id: { type: "text" },
|
|
575
572
|
kind: { type: "text" },
|
|
576
573
|
source_id: { type: "text" },
|
|
577
|
-
occurrence: { type: "
|
|
574
|
+
occurrence: { type: "bigint" },
|
|
578
575
|
state: { type: "text" },
|
|
579
576
|
read_at: { type: "timestamp" },
|
|
580
577
|
archived_at: {
|
|
@@ -749,7 +746,7 @@ function toDeferredDecision(row) {
|
|
|
749
746
|
leaseOwner: row.lease_owner ?? null,
|
|
750
747
|
leaseExpiresAt: row.lease_expires_at ?? null,
|
|
751
748
|
lastError: row.last_error ?? null,
|
|
752
|
-
failureCode:
|
|
749
|
+
failureCode: isStoredFactoryDispatchFailureCode(row.failure_code) ? row.failure_code : null,
|
|
753
750
|
approvedAt: row.approved_at ?? null,
|
|
754
751
|
approvedBy: row.approved_by ?? null,
|
|
755
752
|
completedAt: row.completed_at ?? null,
|
|
@@ -758,7 +755,7 @@ function toDeferredDecision(row) {
|
|
|
758
755
|
};
|
|
759
756
|
}
|
|
760
757
|
function attentionReceiptKind(value) {
|
|
761
|
-
if (value === "automation-failed" || value === "automation-proposed" || value === "mention" || value === "activity" || value === "supervisor-finding") return value;
|
|
758
|
+
if (value === "automation-failed" || value === "automation-proposed" || value === "mention" || value === "activity" || value === "supervisor-finding" || value === "agent-waiting") return value;
|
|
762
759
|
throw new Error(`Unsupported attention receipt kind '${String(value)}'.`);
|
|
763
760
|
}
|
|
764
761
|
function toSupervisorFinding(row) {
|
|
@@ -824,6 +821,7 @@ function toPendingStart(row) {
|
|
|
824
821
|
}
|
|
825
822
|
var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
826
823
|
#attentionChanged = () => {};
|
|
824
|
+
#isTerminal = () => false;
|
|
827
825
|
constructor() {
|
|
828
826
|
super("work-items");
|
|
829
827
|
}
|
|
@@ -835,6 +833,14 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
835
833
|
onAttentionChanged(listener) {
|
|
836
834
|
this.#attentionChanged = listener;
|
|
837
835
|
}
|
|
836
|
+
/**
|
|
837
|
+
* Wired once at boot, before `init()`. Tells the legacy attention sweep and
|
|
838
|
+
* the stale-binding sweep which cards sit in a phase their installed board
|
|
839
|
+
* declares terminal.
|
|
840
|
+
*/
|
|
841
|
+
useTerminalPhasePredicate(isTerminal) {
|
|
842
|
+
this.#isTerminal = isTerminal;
|
|
843
|
+
}
|
|
838
844
|
async init() {
|
|
839
845
|
await this.ensureCollections([
|
|
840
846
|
WORK_ITEMS_SCHEMA,
|
|
@@ -920,7 +926,7 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
920
926
|
factory_project_id: input.factoryProjectId,
|
|
921
927
|
resolved_at: null
|
|
922
928
|
}, {
|
|
923
|
-
orderBy: [["
|
|
929
|
+
orderBy: [["opened_at", "desc"], ["id", "desc"]],
|
|
924
930
|
limit: input.limit + 1,
|
|
925
931
|
...input.before ? { cursor: { values: [input.before.occurredAt, input.before.id] } } : {}
|
|
926
932
|
});
|
|
@@ -1084,6 +1090,14 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
1084
1090
|
}
|
|
1085
1091
|
return cleared;
|
|
1086
1092
|
}
|
|
1093
|
+
async getByProjectSource({ orgId, factoryProjectId, source }) {
|
|
1094
|
+
const row = await this.#db.findOne("work_items", {
|
|
1095
|
+
org_id: orgId,
|
|
1096
|
+
factory_project_id: factoryProjectId,
|
|
1097
|
+
source_key: externalSourceKey(source)
|
|
1098
|
+
});
|
|
1099
|
+
return row ? toWorkItem(row) : null;
|
|
1100
|
+
}
|
|
1087
1101
|
async get({ orgId, id }) {
|
|
1088
1102
|
const row = await this.#db.findOne("work_items", {
|
|
1089
1103
|
org_id: orgId,
|
|
@@ -1209,7 +1223,7 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
1209
1223
|
const evaluation = await ops.insertOne("factory_rule_evaluations", {
|
|
1210
1224
|
ingress_id: ingress.id,
|
|
1211
1225
|
work_item_id: item.id,
|
|
1212
|
-
rule_set_version: input.
|
|
1226
|
+
rule_set_version: input.configVersion,
|
|
1213
1227
|
expected_revision: input.expectedRevision,
|
|
1214
1228
|
outcome,
|
|
1215
1229
|
code,
|
|
@@ -1331,7 +1345,7 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
1331
1345
|
const evaluation = await ops.insertOne("factory_rule_evaluations", {
|
|
1332
1346
|
ingress_id: ingress.id,
|
|
1333
1347
|
work_item_id: item?.id ?? null,
|
|
1334
|
-
rule_set_version: input.
|
|
1348
|
+
rule_set_version: input.configVersion,
|
|
1335
1349
|
expected_revision: input.expectedRevision,
|
|
1336
1350
|
outcome,
|
|
1337
1351
|
code,
|
|
@@ -1534,6 +1548,7 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
1534
1548
|
});
|
|
1535
1549
|
return Boolean(decision) && parked;
|
|
1536
1550
|
}
|
|
1551
|
+
if (identity.kind === "agent-waiting") return true;
|
|
1537
1552
|
if (identity.kind === "activity") return await ops.findOne("work_item_activity", {
|
|
1538
1553
|
work_item_id: identity.sourceId,
|
|
1539
1554
|
participant_id: userId,
|
|
@@ -1827,7 +1842,7 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
1827
1842
|
orgId: decision.orgId,
|
|
1828
1843
|
id: decision.workItemId
|
|
1829
1844
|
});
|
|
1830
|
-
if (!item || !
|
|
1845
|
+
if (!item || !this.#isTerminal(item)) continue;
|
|
1831
1846
|
await this.supersedeDecisionsForWorkItem({
|
|
1832
1847
|
orgId: decision.orgId,
|
|
1833
1848
|
factoryProjectId: decision.factoryProjectId,
|
|
@@ -1978,7 +1993,7 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
1978
1993
|
});
|
|
1979
1994
|
itemCache.set(key, item);
|
|
1980
1995
|
}
|
|
1981
|
-
stale = !item || item.stages.length !== 1 ||
|
|
1996
|
+
stale = !item || item.stages.length !== 1 || this.#isTerminal(item) || item.factoryProjectId !== binding.factoryProjectId;
|
|
1982
1997
|
}
|
|
1983
1998
|
if (!stale) continue;
|
|
1984
1999
|
if (await this.revokeRunBinding({
|
|
@@ -2424,6 +2439,6 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
2424
2439
|
}
|
|
2425
2440
|
};
|
|
2426
2441
|
//#endregion
|
|
2427
|
-
export { FACTORY_PULL_REQUEST_RECONCILIATION_KEY, FACTORY_RULE_MATERIALIZATION_KEY, WORK_ITEMS_SCHEMA, WorkItemRelationError, WorkItemUpdateConflictError, WorkItemsStorage, applyStageTransition, externalSourceKey, factoryActivityAttentionIdentity, factoryAttentionKey, factoryDecisionAttentionIdentity, factoryDecisionHash, factoryMentionAttentionIdentity, factoryProposalAttentionIdentity, factorySupervisorFindingAttentionIdentity, isAgentActor, stampSessions, validateParentRelation };
|
|
2442
|
+
export { FACTORY_PULL_REQUEST_RECONCILIATION_KEY, FACTORY_RULE_MATERIALIZATION_KEY, WORK_ITEMS_SCHEMA, WorkItemRelationError, WorkItemUpdateConflictError, WorkItemsStorage, applyStageTransition, externalSourceKey, factoryActivityAttentionIdentity, factoryAgentWaitingAttentionIdentity, factoryAttentionKey, factoryDecisionAttentionIdentity, factoryDecisionHash, factoryMentionAttentionIdentity, factoryProposalAttentionIdentity, factorySupervisorFindingAttentionIdentity, isAgentActor, stampSessions, validateParentRelation };
|
|
2428
2443
|
|
|
2429
2444
|
//# sourceMappingURL=base.js.map
|