@mastra/factory 0.0.0 → 0.1.0-alpha.3
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/CHANGELOG.md +23 -0
- package/LICENSE.md +30 -0
- package/dist/auth.d.ts +181 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +370 -0
- package/dist/auth.js.map +1 -0
- package/dist/capabilities/connection.d.ts +9 -0
- package/dist/capabilities/connection.d.ts.map +1 -0
- package/dist/capabilities/connection.js +1 -0
- package/dist/capabilities/connection.js.map +1 -0
- package/dist/capabilities/intake.d.ts +93 -0
- package/dist/capabilities/intake.d.ts.map +1 -0
- package/dist/capabilities/intake.js +1 -0
- package/dist/capabilities/intake.js.map +1 -0
- package/dist/capabilities/version-control.d.ts +239 -0
- package/dist/capabilities/version-control.d.ts.map +1 -0
- package/dist/capabilities/version-control.js +1 -0
- package/dist/capabilities/version-control.js.map +1 -0
- package/dist/factory.d.ts +145 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +38245 -0
- package/dist/factory.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38245 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/base.d.ts +197 -0
- package/dist/integrations/base.d.ts.map +1 -0
- package/dist/integrations/base.js +1 -0
- package/dist/integrations/base.js.map +1 -0
- package/dist/integrations/github/config.d.ts +60 -0
- package/dist/integrations/github/config.d.ts.map +1 -0
- package/dist/integrations/github/config.js +28 -0
- package/dist/integrations/github/config.js.map +1 -0
- package/dist/integrations/github/factory-session.d.ts +12 -0
- package/dist/integrations/github/factory-session.d.ts.map +1 -0
- package/dist/integrations/github/factory-session.js +41 -0
- package/dist/integrations/github/factory-session.js.map +1 -0
- package/dist/integrations/github/integration.d.ts +191 -0
- package/dist/integrations/github/integration.d.ts.map +1 -0
- package/dist/integrations/github/integration.js +3001 -0
- package/dist/integrations/github/integration.js.map +1 -0
- package/dist/integrations/github/issue-triage.d.ts +27 -0
- package/dist/integrations/github/issue-triage.d.ts.map +1 -0
- package/dist/integrations/github/issue-triage.js +82 -0
- package/dist/integrations/github/issue-triage.js.map +1 -0
- package/dist/integrations/github/project-lock.d.ts +78 -0
- package/dist/integrations/github/project-lock.d.ts.map +1 -0
- package/dist/integrations/github/project-lock.js +70 -0
- package/dist/integrations/github/project-lock.js.map +1 -0
- package/dist/integrations/github/provenance.d.ts +27 -0
- package/dist/integrations/github/provenance.d.ts.map +1 -0
- package/dist/integrations/github/provenance.js +104 -0
- package/dist/integrations/github/provenance.js.map +1 -0
- package/dist/integrations/github/routes.d.ts +72 -0
- package/dist/integrations/github/routes.d.ts.map +1 -0
- package/dist/integrations/github/routes.js +1834 -0
- package/dist/integrations/github/routes.js.map +1 -0
- package/dist/integrations/github/sandbox.d.ts +268 -0
- package/dist/integrations/github/sandbox.d.ts.map +1 -0
- package/dist/integrations/github/sandbox.js +381 -0
- package/dist/integrations/github/sandbox.js.map +1 -0
- package/dist/integrations/github/session-subscriptions.d.ts +23 -0
- package/dist/integrations/github/session-subscriptions.d.ts.map +1 -0
- package/dist/integrations/github/session-subscriptions.js +190 -0
- package/dist/integrations/github/session-subscriptions.js.map +1 -0
- package/dist/integrations/github/subscriptions.d.ts +54 -0
- package/dist/integrations/github/subscriptions.d.ts.map +1 -0
- package/dist/integrations/github/subscriptions.js +70 -0
- package/dist/integrations/github/subscriptions.js.map +1 -0
- package/dist/integrations/github/webhook.d.ts +87 -0
- package/dist/integrations/github/webhook.d.ts.map +1 -0
- package/dist/integrations/github/webhook.js +381 -0
- package/dist/integrations/github/webhook.js.map +1 -0
- package/dist/integrations/linear/agent-tools.d.ts +34 -0
- package/dist/integrations/linear/agent-tools.d.ts.map +1 -0
- package/dist/integrations/linear/agent-tools.js +108 -0
- package/dist/integrations/linear/agent-tools.js.map +1 -0
- package/dist/integrations/linear/integration.d.ts +233 -0
- package/dist/integrations/linear/integration.d.ts.map +1 -0
- package/dist/integrations/linear/integration.js +962 -0
- package/dist/integrations/linear/integration.js.map +1 -0
- package/dist/integrations/linear/routes.d.ts +61 -0
- package/dist/integrations/linear/routes.d.ts.map +1 -0
- package/dist/integrations/linear/routes.js +242 -0
- package/dist/integrations/linear/routes.js.map +1 -0
- package/dist/integrations/linear/storage.d.ts +65 -0
- package/dist/integrations/linear/storage.d.ts.map +1 -0
- package/dist/integrations/linear/storage.js +1 -0
- package/dist/integrations/linear/storage.js.map +1 -0
- package/dist/integrations/platform/api-client.d.ts +24 -0
- package/dist/integrations/platform/api-client.d.ts.map +1 -0
- package/dist/integrations/platform/api-client.js +153 -0
- package/dist/integrations/platform/api-client.js.map +1 -0
- package/dist/integrations/platform/github/event-worker.d.ts +44 -0
- package/dist/integrations/platform/github/event-worker.d.ts.map +1 -0
- package/dist/integrations/platform/github/event-worker.js +585 -0
- package/dist/integrations/platform/github/event-worker.js.map +1 -0
- package/dist/integrations/platform/github/integration.d.ts +36 -0
- package/dist/integrations/platform/github/integration.d.ts.map +1 -0
- package/dist/integrations/platform/github/integration.js +3253 -0
- package/dist/integrations/platform/github/integration.js.map +1 -0
- package/dist/integrations/platform/linear/integration.d.ts +46 -0
- package/dist/integrations/platform/linear/integration.d.ts.map +1 -0
- package/dist/integrations/platform/linear/integration.js +891 -0
- package/dist/integrations/platform/linear/integration.js.map +1 -0
- package/dist/integrations/workos/integration.d.ts +39 -0
- package/dist/integrations/workos/integration.d.ts.map +1 -0
- package/dist/integrations/workos/integration.js +96 -0
- package/dist/integrations/workos/integration.js.map +1 -0
- package/dist/routes/config.d.ts +220 -0
- package/dist/routes/config.d.ts.map +1 -0
- package/dist/routes/config.js +770 -0
- package/dist/routes/config.js.map +1 -0
- package/dist/routes/fs.d.ts +105 -0
- package/dist/routes/fs.d.ts.map +1 -0
- package/dist/routes/fs.js +294 -0
- package/dist/routes/fs.js.map +1 -0
- package/dist/routes/intake.d.ts +23 -0
- package/dist/routes/intake.d.ts.map +1 -0
- package/dist/routes/intake.js +179 -0
- package/dist/routes/intake.js.map +1 -0
- package/dist/routes/oauth.d.ts +43 -0
- package/dist/routes/oauth.d.ts.map +1 -0
- package/dist/routes/oauth.js +25058 -0
- package/dist/routes/oauth.js.map +1 -0
- package/dist/routes/projects.d.ts +19 -0
- package/dist/routes/projects.d.ts.map +1 -0
- package/dist/routes/projects.js +395 -0
- package/dist/routes/projects.js.map +1 -0
- package/dist/routes/provider-credentials.d.ts +81 -0
- package/dist/routes/provider-credentials.d.ts.map +1 -0
- package/dist/routes/provider-credentials.js +68 -0
- package/dist/routes/provider-credentials.js.map +1 -0
- package/dist/routes/route.d.ts +48 -0
- package/dist/routes/route.d.ts.map +1 -0
- package/dist/routes/route.js +11 -0
- package/dist/routes/route.js.map +1 -0
- package/dist/routes/skills.d.ts +30 -0
- package/dist/routes/skills.d.ts.map +1 -0
- package/dist/routes/skills.js +181 -0
- package/dist/routes/skills.js.map +1 -0
- package/dist/routes/surface.d.ts +83 -0
- package/dist/routes/surface.d.ts.map +1 -0
- package/dist/routes/surface.js +28519 -0
- package/dist/routes/surface.js.map +1 -0
- package/dist/routes/tenant-credentials.d.ts +74 -0
- package/dist/routes/tenant-credentials.d.ts.map +1 -0
- package/dist/routes/tenant-credentials.js +181 -0
- package/dist/routes/tenant-credentials.js.map +1 -0
- package/dist/routes/work-items.d.ts +40 -0
- package/dist/routes/work-items.d.ts.map +1 -0
- package/dist/routes/work-items.js +902 -0
- package/dist/routes/work-items.js.map +1 -0
- package/dist/rules/binding-context.d.ts +5 -0
- package/dist/rules/binding-context.d.ts.map +1 -0
- package/dist/rules/binding-context.js +40 -0
- package/dist/rules/binding-context.js.map +1 -0
- package/dist/rules/defaults.d.ts +9 -0
- package/dist/rules/defaults.d.ts.map +1 -0
- package/dist/rules/defaults.js +334 -0
- package/dist/rules/defaults.js.map +1 -0
- package/dist/rules/dispatcher.d.ts +40 -0
- package/dist/rules/dispatcher.d.ts.map +1 -0
- package/dist/rules/dispatcher.js +695 -0
- package/dist/rules/dispatcher.js.map +1 -0
- package/dist/rules/github-service.d.ts +29 -0
- package/dist/rules/github-service.d.ts.map +1 -0
- package/dist/rules/github-service.js +474 -0
- package/dist/rules/github-service.js.map +1 -0
- package/dist/rules/index.d.ts +7 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +583 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/linear-service.d.ts +27 -0
- package/dist/rules/linear-service.d.ts.map +1 -0
- package/dist/rules/linear-service.js +343 -0
- package/dist/rules/linear-service.js.map +1 -0
- package/dist/rules/processor.d.ts +54 -0
- package/dist/rules/processor.d.ts.map +1 -0
- package/dist/rules/processor.js +629 -0
- package/dist/rules/processor.js.map +1 -0
- package/dist/rules/resolve.d.ts +17 -0
- package/dist/rules/resolve.d.ts.map +1 -0
- package/dist/rules/resolve.js +27 -0
- package/dist/rules/resolve.js.map +1 -0
- package/dist/rules/start-coordinator.d.ts +58 -0
- package/dist/rules/start-coordinator.d.ts.map +1 -0
- package/dist/rules/start-coordinator.js +136 -0
- package/dist/rules/start-coordinator.js.map +1 -0
- package/dist/rules/tools.d.ts +10 -0
- package/dist/rules/tools.d.ts.map +1 -0
- package/dist/rules/tools.js +93 -0
- package/dist/rules/tools.js.map +1 -0
- package/dist/rules/transition-service.d.ts +32 -0
- package/dist/rules/transition-service.d.ts.map +1 -0
- package/dist/rules/transition-service.js +474 -0
- package/dist/rules/transition-service.js.map +1 -0
- package/dist/rules/types.d.ts +225 -0
- package/dist/rules/types.d.ts.map +1 -0
- package/dist/rules/types.js +33 -0
- package/dist/rules/types.js.map +1 -0
- package/dist/rules/validation.d.ts +11 -0
- package/dist/rules/validation.d.ts.map +1 -0
- package/dist/rules/validation.js +310 -0
- package/dist/rules/validation.js.map +1 -0
- package/dist/sandbox/fleet.d.ts +208 -0
- package/dist/sandbox/fleet.d.ts.map +1 -0
- package/dist/sandbox/fleet.js +259 -0
- package/dist/sandbox/fleet.js.map +1 -0
- package/dist/sandbox/reattach.d.ts +3 -0
- package/dist/sandbox/reattach.d.ts.map +1 -0
- package/dist/sandbox/reattach.js +9 -0
- package/dist/sandbox/reattach.js.map +1 -0
- package/dist/server-error.d.ts +12 -0
- package/dist/server-error.d.ts.map +1 -0
- package/dist/server-error.js +20 -0
- package/dist/server-error.js.map +1 -0
- package/dist/skills/service.d.ts +48 -0
- package/dist/skills/service.d.ts.map +1 -0
- package/dist/skills/service.js +45 -0
- package/dist/skills/service.js.map +1 -0
- package/dist/spa-static.d.ts +34 -0
- package/dist/spa-static.d.ts.map +1 -0
- package/dist/spa-static.js +73 -0
- package/dist/spa-static.js.map +1 -0
- package/dist/state-signing.d.ts +48 -0
- package/dist/state-signing.d.ts.map +1 -0
- package/dist/state-signing.js +48 -0
- package/dist/state-signing.js.map +1 -0
- package/dist/storage/domains/audit/agent-audit.d.ts +27 -0
- package/dist/storage/domains/audit/agent-audit.d.ts.map +1 -0
- package/dist/storage/domains/audit/agent-audit.js +65 -0
- package/dist/storage/domains/audit/agent-audit.js.map +1 -0
- package/dist/storage/domains/audit/base.d.ts +140 -0
- package/dist/storage/domains/audit/base.d.ts.map +1 -0
- package/dist/storage/domains/audit/base.js +127 -0
- package/dist/storage/domains/audit/base.js.map +1 -0
- package/dist/storage/domains/audit/domain.d.ts +69 -0
- package/dist/storage/domains/audit/domain.d.ts.map +1 -0
- package/dist/storage/domains/audit/domain.js +165 -0
- package/dist/storage/domains/audit/domain.js.map +1 -0
- package/dist/storage/domains/credentials/base.d.ts +134 -0
- package/dist/storage/domains/credentials/base.d.ts.map +1 -0
- package/dist/storage/domains/credentials/base.js +257 -0
- package/dist/storage/domains/credentials/base.js.map +1 -0
- package/dist/storage/domains/intake/base.d.ts +38 -0
- package/dist/storage/domains/intake/base.d.ts.map +1 -0
- package/dist/storage/domains/intake/base.js +62 -0
- package/dist/storage/domains/intake/base.js.map +1 -0
- package/dist/storage/domains/integrations/base.d.ts +126 -0
- package/dist/storage/domains/integrations/base.d.ts.map +1 -0
- package/dist/storage/domains/integrations/base.js +252 -0
- package/dist/storage/domains/integrations/base.js.map +1 -0
- package/dist/storage/domains/model-packs/base.d.ts +49 -0
- package/dist/storage/domains/model-packs/base.d.ts.map +1 -0
- package/dist/storage/domains/model-packs/base.js +95 -0
- package/dist/storage/domains/model-packs/base.js.map +1 -0
- package/dist/storage/domains/projects/base.d.ts +55 -0
- package/dist/storage/domains/projects/base.d.ts.map +1 -0
- package/dist/storage/domains/projects/base.js +99 -0
- package/dist/storage/domains/projects/base.js.map +1 -0
- package/dist/storage/domains/queue-health/base.d.ts +52 -0
- package/dist/storage/domains/queue-health/base.d.ts.map +1 -0
- package/dist/storage/domains/queue-health/base.js +87 -0
- package/dist/storage/domains/queue-health/base.js.map +1 -0
- package/dist/storage/domains/source-control/base.d.ts +288 -0
- package/dist/storage/domains/source-control/base.d.ts.map +1 -0
- package/dist/storage/domains/source-control/base.js +722 -0
- package/dist/storage/domains/source-control/base.js.map +1 -0
- package/dist/storage/domains/source-control/inmemory.d.ts +158 -0
- package/dist/storage/domains/source-control/inmemory.d.ts.map +1 -0
- package/dist/storage/domains/source-control/inmemory.js +348 -0
- package/dist/storage/domains/source-control/inmemory.js.map +1 -0
- package/dist/storage/domains/work-items/base.d.ts +412 -0
- package/dist/storage/domains/work-items/base.d.ts.map +1 -0
- package/dist/storage/domains/work-items/base.js +1174 -0
- package/dist/storage/domains/work-items/base.js.map +1 -0
- package/dist/storage/domains/work-items/metrics.d.ts +101 -0
- package/dist/storage/domains/work-items/metrics.d.ts.map +1 -0
- package/dist/storage/domains/work-items/metrics.js +203 -0
- package/dist/storage/domains/work-items/metrics.js.map +1 -0
- package/dist/workspace.d.ts +20 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +364 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +19 -19
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/storage/domains/source-control/inmemory.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\n\nimport type {\n CreateProjectSourceControlConnectionInput,\n CreateSourceControlSessionInput,\n ExternalRepositoryProjectTarget,\n LinkProjectRepositoryInput,\n ProjectRepository,\n ProjectRepositorySandbox,\n ProjectSourceControlConnection,\n SourceControlInstallation,\n SourceControlRepository,\n SourceControlSession,\n SourceControlStorageHandle,\n SourceControlWorktree,\n UpdateProjectRepositoryInput,\n UpsertSourceControlInstallationInput,\n UpsertSourceControlRepositoryInput,\n UpsertSourceControlWorktreeInput,\n} from './base.js';\n\n/** In-memory provider-scoped source-control handle for route tests. */\nexport class SourceControlStorageInMemory implements SourceControlStorageHandle {\n readonly integrationId: string;\n installationsRows: SourceControlInstallation[] = [];\n repositoriesRows: SourceControlRepository[] = [];\n connectionsRows: ProjectSourceControlConnection[] = [];\n projectRepositoriesRows: ProjectRepository[] = [];\n sandboxesRows: ProjectRepositorySandbox[] = [];\n worktreesRows: SourceControlWorktree[] = [];\n sessionsRows: SourceControlSession[] = [];\n\n constructor(integrationId = 'github') {\n this.integrationId = integrationId;\n }\n\n readonly installations = {\n list: async ({ orgId }: { orgId: string }): Promise<SourceControlInstallation[]> =>\n this.installationsRows.filter(row => row.orgId === orgId),\n get: async ({ orgId, id }: { orgId: string; id: string }): Promise<SourceControlInstallation | null> =>\n this.installationsRows.find(row => row.orgId === orgId && row.id === id) ?? null,\n findByExternalId: async ({\n orgId,\n externalId,\n }: {\n orgId: string;\n externalId: string;\n }): Promise<SourceControlInstallation | null> =>\n this.installationsRows.find(row => row.orgId === orgId && row.externalId === externalId) ?? null,\n upsert: async (input: UpsertSourceControlInstallationInput): Promise<SourceControlInstallation> => {\n const existing = this.installationsRows.find(\n row => row.orgId === input.orgId && row.externalId === input.externalId,\n );\n if (existing) {\n Object.assign(existing, {\n connectedByUserId: input.connectedByUserId,\n accountName: input.accountName ?? null,\n accountType: input.accountType ?? null,\n providerMetadata: input.providerMetadata ?? {},\n });\n return existing;\n }\n const created: SourceControlInstallation = {\n id: randomUUID(),\n integrationId: this.integrationId,\n orgId: input.orgId,\n connectedByUserId: input.connectedByUserId,\n externalId: input.externalId,\n accountName: input.accountName ?? null,\n accountType: input.accountType ?? null,\n providerMetadata: input.providerMetadata ?? {},\n createdAt: new Date(),\n };\n this.installationsRows.push(created);\n return created;\n },\n delete: async ({ orgId, id }: { orgId: string; id: string }): Promise<boolean> => {\n const index = this.installationsRows.findIndex(row => row.orgId === orgId && row.id === id);\n if (index < 0) return false;\n this.installationsRows.splice(index, 1);\n return true;\n },\n };\n\n readonly repositories = {\n list: async ({ orgId, installationId }: { orgId: string; installationId: string }) => {\n const installation = await this.installations.get({ orgId, id: installationId });\n return installation ? this.repositoriesRows.filter(row => row.installationId === installationId) : [];\n },\n get: async ({ orgId, id }: { orgId: string; id: string }): Promise<SourceControlRepository | null> => {\n const row = this.repositoriesRows.find(candidate => candidate.id === id);\n if (!row) return null;\n return (await this.installations.get({ orgId, id: row.installationId })) ? row : null;\n },\n findByExternalId: async ({\n orgId,\n installationId,\n externalId,\n }: {\n orgId: string;\n installationId: string;\n externalId: string;\n }) => {\n const rows = await this.repositories.list({ orgId, installationId });\n return rows.find(row => row.externalId === externalId) ?? null;\n },\n findBySlug: async ({ orgId, installationId, slug }: { orgId: string; installationId: string; slug: string }) => {\n const rows = await this.repositories.list({ orgId, installationId });\n return rows.find(row => row.slug === slug) ?? null;\n },\n upsert: async ({\n orgId,\n input,\n }: {\n orgId: string;\n input: UpsertSourceControlRepositoryInput;\n }): Promise<SourceControlRepository> => {\n if (!(await this.installations.get({ orgId, id: input.installationId }))) {\n throw new Error('Source-control installation not found');\n }\n const existing = this.repositoriesRows.find(\n row => row.installationId === input.installationId && row.externalId === input.externalId,\n );\n const now = new Date();\n if (existing) {\n Object.assign(existing, {\n slug: input.slug,\n defaultBranch: input.defaultBranch,\n providerMetadata: input.providerMetadata ?? {},\n updatedAt: now,\n });\n return existing;\n }\n const created: SourceControlRepository = {\n id: randomUUID(),\n installationId: input.installationId,\n externalId: input.externalId,\n slug: input.slug,\n defaultBranch: input.defaultBranch,\n providerMetadata: input.providerMetadata ?? {},\n createdAt: now,\n updatedAt: now,\n };\n this.repositoriesRows.push(created);\n return created;\n },\n };\n\n readonly connections = {\n list: async ({ factoryProjectId }: { orgId: string; factoryProjectId: string }) =>\n this.connectionsRows.filter(row => row.factoryProjectId === factoryProjectId),\n get: async ({ orgId, id }: { orgId: string; id: string }): Promise<ProjectSourceControlConnection | null> => {\n const row = this.connectionsRows.find(candidate => candidate.id === id);\n if (!row) return null;\n return (await this.installations.get({ orgId, id: row.installationId })) ? row : null;\n },\n create: async (input: CreateProjectSourceControlConnectionInput): Promise<ProjectSourceControlConnection> => {\n if (!(await this.installations.get({ orgId: input.orgId, id: input.installationId }))) {\n throw new Error('Source-control installation not found');\n }\n const existing = this.connectionsRows.find(\n row =>\n row.factoryProjectId === input.factoryProjectId &&\n row.integrationId === this.integrationId &&\n row.installationId === input.installationId,\n );\n if (existing) return existing;\n const created: ProjectSourceControlConnection = {\n id: randomUUID(),\n factoryProjectId: input.factoryProjectId,\n integrationId: this.integrationId,\n installationId: input.installationId,\n createdByUserId: input.createdByUserId,\n createdAt: new Date(),\n };\n this.connectionsRows.push(created);\n return created;\n },\n delete: async ({ orgId, id }: { orgId: string; id: string }): Promise<boolean> => {\n if (!(await this.connections.get({ orgId, id }))) return false;\n this.connectionsRows.splice(0, this.connectionsRows.length, ...this.connectionsRows.filter(row => row.id !== id));\n return true;\n },\n };\n\n readonly projectRepositories = {\n list: async ({ orgId, connectionId }: { orgId: string; connectionId: string }) =>\n (await this.connections.get({ orgId, id: connectionId }))\n ? this.projectRepositoriesRows.filter(row => row.connectionId === connectionId)\n : [],\n listByExternalRepository: async ({\n installationExternalId,\n repositoryExternalId,\n }: {\n installationExternalId: string;\n repositoryExternalId: string;\n }): Promise<ExternalRepositoryProjectTarget[]> => {\n const targets: ExternalRepositoryProjectTarget[] = [];\n for (const installation of this.installationsRows.filter(row => row.externalId === installationExternalId)) {\n const repository = this.repositoriesRows.find(\n row => row.installationId === installation.id && row.externalId === repositoryExternalId,\n );\n if (!repository) continue;\n for (const projectRepository of this.projectRepositoriesRows.filter(\n row => row.repositoryId === repository.id,\n )) {\n const connection = this.connectionsRows.find(\n row =>\n row.id === projectRepository.connectionId &&\n row.installationId === installation.id &&\n row.integrationId === this.integrationId,\n );\n if (!connection) continue;\n targets.push({\n orgId: installation.orgId,\n factoryProjectId: connection.factoryProjectId,\n projectRepository,\n });\n }\n }\n return targets;\n },\n get: async ({ orgId, id }: { orgId: string; id: string }): Promise<ProjectRepository | null> => {\n const row = this.projectRepositoriesRows.find(candidate => candidate.id === id);\n if (!row) return null;\n return (await this.connections.get({ orgId, id: row.connectionId })) ? row : null;\n },\n link: async (input: LinkProjectRepositoryInput): Promise<ProjectRepository> => {\n const connection = await this.connections.get({ orgId: input.orgId, id: input.connectionId });\n const repository = await this.repositories.get({ orgId: input.orgId, id: input.repositoryId });\n if (!connection || !repository || repository.installationId !== connection.installationId) {\n throw new Error('Source-control connection or repository not found');\n }\n const existing = this.projectRepositoriesRows.find(\n row => row.connectionId === input.connectionId && row.repositoryId === input.repositoryId,\n );\n if (existing) return existing;\n const now = new Date();\n const created: ProjectRepository = {\n id: randomUUID(),\n connectionId: input.connectionId,\n repositoryId: input.repositoryId,\n createdByUserId: input.createdByUserId,\n branch: input.branch ?? null,\n sandboxProvider: input.sandboxProvider,\n sandboxWorkdir: input.sandboxWorkdir,\n setupCommand: input.setupCommand ?? null,\n createdAt: now,\n updatedAt: now,\n };\n this.projectRepositoriesRows.push(created);\n return created;\n },\n update: async ({\n orgId,\n id,\n input,\n }: {\n orgId: string;\n id: string;\n input: UpdateProjectRepositoryInput;\n }): Promise<ProjectRepository | null> => {\n const row = await this.projectRepositories.get({ orgId, id });\n if (!row) return null;\n Object.assign(row, input, { updatedAt: new Date() });\n return row;\n },\n unlink: async ({ orgId, id }: { orgId: string; id: string }): Promise<boolean> => {\n if (!(await this.projectRepositories.get({ orgId, id }))) return false;\n this.projectRepositoriesRows.splice(\n 0,\n this.projectRepositoriesRows.length,\n ...this.projectRepositoriesRows.filter(row => row.id !== id),\n );\n return true;\n },\n };\n\n readonly sandboxes = {\n getOrCreate: async ({\n projectRepository,\n userId,\n }: {\n projectRepository: ProjectRepository;\n userId: string;\n }): Promise<ProjectRepositorySandbox> => {\n const existing = this.sandboxesRows.find(\n row => row.projectRepositoryId === projectRepository.id && row.userId === userId,\n );\n if (existing) return existing;\n const created: ProjectRepositorySandbox = {\n id: randomUUID(),\n projectRepositoryId: projectRepository.id,\n userId,\n sandboxId: null,\n sandboxWorkdir: projectRepository.sandboxWorkdir,\n materializedAt: null,\n createdAt: new Date(),\n };\n this.sandboxesRows.push(created);\n return created;\n },\n getById: async ({ id }: { id: string }): Promise<ProjectRepositorySandbox | null> =>\n this.sandboxesRows.find(row => row.id === id) ?? null,\n setSandboxId: async ({ id, sandboxId }: { id: string; sandboxId: string }): Promise<void> => {\n const row = this.sandboxesRows.find(candidate => candidate.id === id);\n if (row) row.sandboxId = sandboxId;\n },\n clearBinding: async ({ id }: { id: string }): Promise<void> => {\n const row = this.sandboxesRows.find(candidate => candidate.id === id);\n if (row) Object.assign(row, { sandboxId: null, materializedAt: null });\n },\n markMaterialized: async ({ id }: { id: string }): Promise<void> => {\n const row = this.sandboxesRows.find(candidate => candidate.id === id);\n if (row) row.materializedAt = new Date();\n },\n };\n\n readonly worktrees = {\n upsert: async (input: UpsertSourceControlWorktreeInput): Promise<void> => {\n const existing = this.worktreesRows.find(\n row =>\n row.projectRepositoryId === input.projectRepositoryId &&\n row.userId === input.userId &&\n row.branch === input.branch,\n );\n if (existing) {\n existing.baseBranch = input.baseBranch;\n existing.worktreePath = input.worktreePath;\n return;\n }\n this.worktreesRows.push({ id: randomUUID(), createdAt: new Date(), ...input });\n },\n list: async ({\n projectRepositoryId,\n userId,\n }: {\n projectRepositoryId: string;\n userId: string;\n }): Promise<SourceControlWorktree[]> =>\n this.worktreesRows.filter(row => row.projectRepositoryId === projectRepositoryId && row.userId === userId),\n get: async ({\n projectRepositoryId,\n userId,\n branch,\n }: {\n projectRepositoryId: string;\n userId: string;\n branch: string;\n }): Promise<SourceControlWorktree | null> =>\n this.worktreesRows.find(\n row => row.projectRepositoryId === projectRepositoryId && row.userId === userId && row.branch === branch,\n ) ?? null,\n findByPath: async ({\n projectRepositoryId,\n userId,\n worktreePath,\n }: {\n projectRepositoryId: string;\n userId: string;\n worktreePath: string;\n }): Promise<SourceControlWorktree | null> =>\n this.worktreesRows.find(\n row =>\n row.projectRepositoryId === projectRepositoryId && row.userId === userId && row.worktreePath === worktreePath,\n ) ?? null,\n delete: async ({\n projectRepositoryId,\n userId,\n branch,\n }: {\n projectRepositoryId: string;\n userId: string;\n branch: string;\n }): Promise<void> => {\n this.worktreesRows.splice(\n 0,\n this.worktreesRows.length,\n ...this.worktreesRows.filter(\n row => !(row.projectRepositoryId === projectRepositoryId && row.userId === userId && row.branch === branch),\n ),\n );\n },\n };\n\n readonly sessions = {\n list: async ({ projectRepositoryId, userId }: { projectRepositoryId: string; userId: string }) =>\n this.sessionsRows.filter(row => row.projectRepositoryId === projectRepositoryId && row.userId === userId),\n getBySessionId: async (sessionId: string): Promise<SourceControlSession | null> =>\n this.sessionsRows.find(row => row.sessionId === sessionId) ?? null,\n getForBranch: async ({\n projectRepositoryId,\n userId,\n branch,\n }: {\n projectRepositoryId: string;\n userId: string;\n branch: string;\n }): Promise<SourceControlSession | null> =>\n this.sessionsRows.find(\n row => row.projectRepositoryId === projectRepositoryId && row.userId === userId && row.branch === branch,\n ) ?? null,\n create: async (input: CreateSourceControlSessionInput): Promise<SourceControlSession> => {\n const existing = await this.sessions.getForBranch(input);\n if (existing) return existing;\n const now = new Date();\n const session: SourceControlSession = {\n id: randomUUID(),\n ...input,\n sandboxId: null,\n sandboxWorkdir: null,\n materializedAt: null,\n createdAt: now,\n updatedAt: now,\n };\n this.sessionsRows.push(session);\n return session;\n },\n setSandbox: async ({\n id,\n sandboxId,\n sandboxWorkdir,\n }: {\n id: string;\n sandboxId: string | null;\n sandboxWorkdir: string;\n }) => {\n const row = this.sessionsRows.find(candidate => candidate.id === id);\n if (row) Object.assign(row, { sandboxId, sandboxWorkdir, updatedAt: new Date() });\n },\n markMaterialized: async ({ id }: { id: string }) => {\n const row = this.sessionsRows.find(candidate => candidate.id === id);\n if (row) Object.assign(row, { materializedAt: new Date(), updatedAt: new Date() });\n },\n delete: async (id: string) => {\n this.sessionsRows.splice(0, this.sessionsRows.length, ...this.sessionsRows.filter(row => row.id !== id));\n },\n };\n}\n"],"mappings":";AAAA,SAAS,kBAAkB;AAsBpB,IAAM,+BAAN,MAAyE;AAAA,EACrE;AAAA,EACT,oBAAiD,CAAC;AAAA,EAClD,mBAA8C,CAAC;AAAA,EAC/C,kBAAoD,CAAC;AAAA,EACrD,0BAA+C,CAAC;AAAA,EAChD,gBAA4C,CAAC;AAAA,EAC7C,gBAAyC,CAAC;AAAA,EAC1C,eAAuC,CAAC;AAAA,EAExC,YAAY,gBAAgB,UAAU;AACpC,SAAK,gBAAgB;AAAA,EACvB;AAAA,EAES,gBAAgB;AAAA,IACvB,MAAM,OAAO,EAAE,MAAM,MACnB,KAAK,kBAAkB,OAAO,SAAO,IAAI,UAAU,KAAK;AAAA,IAC1D,KAAK,OAAO,EAAE,OAAO,GAAG,MACtB,KAAK,kBAAkB,KAAK,SAAO,IAAI,UAAU,SAAS,IAAI,OAAO,EAAE,KAAK;AAAA,IAC9E,kBAAkB,OAAO;AAAA,MACvB;AAAA,MACA;AAAA,IACF,MAIE,KAAK,kBAAkB,KAAK,SAAO,IAAI,UAAU,SAAS,IAAI,eAAe,UAAU,KAAK;AAAA,IAC9F,QAAQ,OAAO,UAAoF;AACjG,YAAM,WAAW,KAAK,kBAAkB;AAAA,QACtC,SAAO,IAAI,UAAU,MAAM,SAAS,IAAI,eAAe,MAAM;AAAA,MAC/D;AACA,UAAI,UAAU;AACZ,eAAO,OAAO,UAAU;AAAA,UACtB,mBAAmB,MAAM;AAAA,UACzB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I,WAAW,UAAU,IAAI,WAAW;AAAA,IACpG,KAAK;AAAA,IACP,QAAQ,OAAO,UAA0E;AACvF,YAAM,WAAW,MAAM,KAAK,SAAS,aAAa,KAAK;AACvD,UAAI,SAAU,QAAO;AACrB,YAAM,MAAM,oBAAI,KAAK;AACrB,YAAM,UAAgC;AAAA,QACpC,IAAI,WAAW;AAAA,QACf,GAAG;AAAA,QACH,WAAW;AAAA,QACX,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,QAChB,WAAW;AAAA,QACX,WAAW;AAAA,MACb;AACA,WAAK,aAAa,KAAK,OAAO;AAC9B,aAAO;AAAA,IACT;AAAA,IACA,YAAY,OAAO;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,IACF,MAIM;AACJ,YAAM,MAAM,KAAK,aAAa,KAAK,eAAa,UAAU,OAAO,EAAE;AACnE,UAAI,IAAK,QAAO,OAAO,KAAK,EAAE,WAAW,gBAAgB,WAAW,oBAAI,KAAK,EAAE,CAAC;AAAA,IAClF;AAAA,IACA,kBAAkB,OAAO,EAAE,GAAG,MAAsB;AAClD,YAAM,MAAM,KAAK,aAAa,KAAK,eAAa,UAAU,OAAO,EAAE;AACnE,UAAI,IAAK,QAAO,OAAO,KAAK,EAAE,gBAAgB,oBAAI,KAAK,GAAG,WAAW,oBAAI,KAAK,EAAE,CAAC;AAAA,IACnF;AAAA,IACA,QAAQ,OAAO,OAAe;AAC5B,WAAK,aAAa,OAAO,GAAG,KAAK,aAAa,QAAQ,GAAG,KAAK,aAAa,OAAO,SAAO,IAAI,OAAO,EAAE,CAAC;AAAA,IACzG;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory work-items storage domain.
|
|
3
|
+
*
|
|
4
|
+
* Work items belong to a first-class Factory project. External intake items use
|
|
5
|
+
* a provider-neutral source reference; manual work items have no source.
|
|
6
|
+
* Stage history is server-owned, while session and metadata patches merge
|
|
7
|
+
* atomically so concurrent actors do not overwrite each other. The authoritative
|
|
8
|
+
* Factory transition path keeps one exclusive current stage per item.
|
|
9
|
+
*/
|
|
10
|
+
import { FactoryStorageDomain } from '@mastra/core/storage';
|
|
11
|
+
import type { CollectionSchema } from '@mastra/core/storage';
|
|
12
|
+
export type WorkItemStage = string;
|
|
13
|
+
export declare function factoryDecisionHash(decision: Record<string, unknown>): string;
|
|
14
|
+
export interface ExternalWorkItemSource {
|
|
15
|
+
integrationId: string;
|
|
16
|
+
type: string;
|
|
17
|
+
externalId: string;
|
|
18
|
+
url?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface WorkItemStageEntry {
|
|
21
|
+
stage: WorkItemStage;
|
|
22
|
+
enteredAt: string;
|
|
23
|
+
exitedAt?: string;
|
|
24
|
+
by: string;
|
|
25
|
+
/**
|
|
26
|
+
* Actor that closed this entry; absent on entries written before exit
|
|
27
|
+
* stamping existed — treat as human.
|
|
28
|
+
*/
|
|
29
|
+
exitedBy?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Sentinel actor ids that mark a stage transition as automation-driven (vs a
|
|
33
|
+
* human's WorkOS user id): generic sentinels plus the system ids the Factory
|
|
34
|
+
* rules engine stamps (see `actorId` in factory/rules/transition-service.ts).
|
|
35
|
+
* Metrics treat any other actor — including a missing `exitedBy` on
|
|
36
|
+
* pre-existing entries — as human.
|
|
37
|
+
*/
|
|
38
|
+
export declare const AUTOMATION_ACTORS: Set<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Whether an actor id marks a transition no human performed on the Factory
|
|
41
|
+
* board: a sentinel automation id, an agent binding (`agent:*`), or an
|
|
42
|
+
* external-webhook actor (`github:*` — a human may have acted on GitHub, but
|
|
43
|
+
* the board move itself was automated).
|
|
44
|
+
*/
|
|
45
|
+
export declare function isAutomationActor(by: string | undefined): boolean;
|
|
46
|
+
export interface WorkItemSessionRef {
|
|
47
|
+
sessionId: string;
|
|
48
|
+
branch: string;
|
|
49
|
+
threadId: string;
|
|
50
|
+
startedBy: string;
|
|
51
|
+
}
|
|
52
|
+
export interface FactoryRuleIngressRecord {
|
|
53
|
+
id: string;
|
|
54
|
+
orgId: string;
|
|
55
|
+
factoryProjectId: string;
|
|
56
|
+
identity: string;
|
|
57
|
+
triggerType: string;
|
|
58
|
+
transitionId: string;
|
|
59
|
+
result: Record<string, unknown>;
|
|
60
|
+
createdAt: Date;
|
|
61
|
+
}
|
|
62
|
+
export interface CommitFactoryRuleEvaluationInput {
|
|
63
|
+
orgId: string;
|
|
64
|
+
factoryProjectId: string;
|
|
65
|
+
workItemId: string | null;
|
|
66
|
+
ingress: {
|
|
67
|
+
identity: string;
|
|
68
|
+
triggerType: string;
|
|
69
|
+
};
|
|
70
|
+
ruleSetVersion: string;
|
|
71
|
+
expectedRevision: number | null;
|
|
72
|
+
actor: Record<string, unknown> | null;
|
|
73
|
+
outcome: {
|
|
74
|
+
status: 'accepted' | 'rejected';
|
|
75
|
+
code?: string;
|
|
76
|
+
reason?: string;
|
|
77
|
+
};
|
|
78
|
+
decisions: Record<string, unknown>[];
|
|
79
|
+
causalChain: Array<{
|
|
80
|
+
ingressId: string;
|
|
81
|
+
decisionType: string;
|
|
82
|
+
}>;
|
|
83
|
+
now: Date;
|
|
84
|
+
}
|
|
85
|
+
export type CommitFactoryRuleEvaluationResult = {
|
|
86
|
+
status: 'committed';
|
|
87
|
+
result: Record<string, unknown>;
|
|
88
|
+
} | {
|
|
89
|
+
status: 'replayed';
|
|
90
|
+
result: Record<string, unknown>;
|
|
91
|
+
} | {
|
|
92
|
+
status: 'missing';
|
|
93
|
+
};
|
|
94
|
+
export interface FactoryToolResultCursorRecord {
|
|
95
|
+
bindingId: string;
|
|
96
|
+
orgId: string;
|
|
97
|
+
factoryProjectId: string;
|
|
98
|
+
lastMessageId: string;
|
|
99
|
+
lastMessageCreatedAt: Date;
|
|
100
|
+
updatedAt: Date;
|
|
101
|
+
}
|
|
102
|
+
export interface FactoryRuleEvaluationRecord {
|
|
103
|
+
id: string;
|
|
104
|
+
ingressId: string;
|
|
105
|
+
workItemId: string | null;
|
|
106
|
+
ruleSetVersion: string;
|
|
107
|
+
expectedRevision: number | null;
|
|
108
|
+
outcome: 'accepted' | 'rejected';
|
|
109
|
+
code: string | null;
|
|
110
|
+
reason: string | null;
|
|
111
|
+
causalChain: Array<{
|
|
112
|
+
ingressId: string;
|
|
113
|
+
decisionType: string;
|
|
114
|
+
}>;
|
|
115
|
+
createdAt: Date;
|
|
116
|
+
}
|
|
117
|
+
export type FactoryDispatchStatus = 'pending' | 'leased' | 'retry' | 'succeeded' | 'failed';
|
|
118
|
+
export interface FactoryDeferredDecisionPageInput {
|
|
119
|
+
orgId: string;
|
|
120
|
+
factoryProjectId: string;
|
|
121
|
+
statuses?: FactoryDispatchStatus[];
|
|
122
|
+
before?: {
|
|
123
|
+
createdAt: Date;
|
|
124
|
+
id: string;
|
|
125
|
+
};
|
|
126
|
+
limit: number;
|
|
127
|
+
}
|
|
128
|
+
export interface FactoryDeferredDecisionPage {
|
|
129
|
+
decisions: FactoryDeferredDecisionRecord[];
|
|
130
|
+
hasMore: boolean;
|
|
131
|
+
}
|
|
132
|
+
export interface FactoryDeferredDecisionRecord {
|
|
133
|
+
id: string;
|
|
134
|
+
orgId: string;
|
|
135
|
+
factoryProjectId: string;
|
|
136
|
+
evaluationId: string;
|
|
137
|
+
workItemId: string | null;
|
|
138
|
+
idempotencyKey: string;
|
|
139
|
+
effectOrdinal: number;
|
|
140
|
+
effectHash: string;
|
|
141
|
+
causalChain: Array<{
|
|
142
|
+
ingressId: string;
|
|
143
|
+
decisionType: string;
|
|
144
|
+
}>;
|
|
145
|
+
actor: Record<string, unknown> | null;
|
|
146
|
+
decision: Record<string, unknown>;
|
|
147
|
+
status: FactoryDispatchStatus;
|
|
148
|
+
attempts: number;
|
|
149
|
+
availableAt: Date;
|
|
150
|
+
leaseOwner: string | null;
|
|
151
|
+
leaseExpiresAt: Date | null;
|
|
152
|
+
lastError: string | null;
|
|
153
|
+
completedAt: Date | null;
|
|
154
|
+
createdAt: Date;
|
|
155
|
+
updatedAt: Date;
|
|
156
|
+
}
|
|
157
|
+
export interface FactoryRunBindingSessionAddress {
|
|
158
|
+
factoryProjectId: string;
|
|
159
|
+
threadId: string;
|
|
160
|
+
resourceId: string;
|
|
161
|
+
sessionId: string;
|
|
162
|
+
}
|
|
163
|
+
export interface FactoryRunBindingAddress extends FactoryRunBindingSessionAddress {
|
|
164
|
+
orgId: string;
|
|
165
|
+
}
|
|
166
|
+
export interface RevokeFactoryRunBindingInput {
|
|
167
|
+
orgId: string;
|
|
168
|
+
factoryProjectId: string;
|
|
169
|
+
bindingId: string;
|
|
170
|
+
revokedAt: Date;
|
|
171
|
+
}
|
|
172
|
+
export interface FactoryRunBindingRecord {
|
|
173
|
+
id: string;
|
|
174
|
+
orgId: string;
|
|
175
|
+
factoryProjectId: string;
|
|
176
|
+
workItemId: string;
|
|
177
|
+
role: string;
|
|
178
|
+
threadId: string;
|
|
179
|
+
resourceId: string;
|
|
180
|
+
sessionId: string;
|
|
181
|
+
branch: string;
|
|
182
|
+
status: 'active' | 'revoked';
|
|
183
|
+
createdAt: Date;
|
|
184
|
+
revokedAt: Date | null;
|
|
185
|
+
}
|
|
186
|
+
export interface FactoryPendingStartRecord {
|
|
187
|
+
id: string;
|
|
188
|
+
orgId: string;
|
|
189
|
+
factoryProjectId: string;
|
|
190
|
+
bindingId: string;
|
|
191
|
+
kickoffKey: string;
|
|
192
|
+
message: string | null;
|
|
193
|
+
status: 'pending' | 'leased' | 'retry' | 'sent' | 'failed';
|
|
194
|
+
attempts: number;
|
|
195
|
+
availableAt: Date;
|
|
196
|
+
leaseOwner: string | null;
|
|
197
|
+
leaseExpiresAt: Date | null;
|
|
198
|
+
lastError: string | null;
|
|
199
|
+
completedAt: Date | null;
|
|
200
|
+
createdAt: Date;
|
|
201
|
+
updatedAt: Date;
|
|
202
|
+
}
|
|
203
|
+
export interface FactoryLeaseClaimInput {
|
|
204
|
+
ownerId: string;
|
|
205
|
+
now: Date;
|
|
206
|
+
leaseExpiresAt: Date;
|
|
207
|
+
limit: number;
|
|
208
|
+
}
|
|
209
|
+
export interface FactoryLeaseIdentity {
|
|
210
|
+
id: string;
|
|
211
|
+
orgId: string;
|
|
212
|
+
factoryProjectId: string;
|
|
213
|
+
ownerId: string;
|
|
214
|
+
}
|
|
215
|
+
export interface FactoryDispatchFailureInput extends FactoryLeaseIdentity {
|
|
216
|
+
now: Date;
|
|
217
|
+
availableAt: Date;
|
|
218
|
+
lastError: string;
|
|
219
|
+
terminal: boolean;
|
|
220
|
+
}
|
|
221
|
+
export interface CommitFactoryTransitionInput {
|
|
222
|
+
orgId: string;
|
|
223
|
+
factoryProjectId: string;
|
|
224
|
+
workItemId: string;
|
|
225
|
+
expectedRevision: number;
|
|
226
|
+
destinationStage: string;
|
|
227
|
+
actorId: string;
|
|
228
|
+
ingress: {
|
|
229
|
+
identity: string;
|
|
230
|
+
triggerType: string;
|
|
231
|
+
transitionId: string;
|
|
232
|
+
};
|
|
233
|
+
ruleSetVersion: string;
|
|
234
|
+
causalChain: Array<{
|
|
235
|
+
ingressId: string;
|
|
236
|
+
decisionType: string;
|
|
237
|
+
}>;
|
|
238
|
+
evaluation: {
|
|
239
|
+
outcome: 'accepted';
|
|
240
|
+
decisions: Record<string, unknown>[];
|
|
241
|
+
} | {
|
|
242
|
+
outcome: 'rejected';
|
|
243
|
+
code: string;
|
|
244
|
+
reason: string;
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
export type CommitFactoryTransitionResult = {
|
|
248
|
+
status: 'committed';
|
|
249
|
+
item: WorkItemRow | null;
|
|
250
|
+
result: Record<string, unknown>;
|
|
251
|
+
} | {
|
|
252
|
+
status: 'replayed';
|
|
253
|
+
item: WorkItemRow | null;
|
|
254
|
+
result: Record<string, unknown>;
|
|
255
|
+
} | {
|
|
256
|
+
status: 'missing';
|
|
257
|
+
};
|
|
258
|
+
export interface PrepareFactoryRunStartInput {
|
|
259
|
+
orgId: string;
|
|
260
|
+
userId: string;
|
|
261
|
+
factoryProjectId: string;
|
|
262
|
+
workItem: {
|
|
263
|
+
id?: string;
|
|
264
|
+
input: CreateWorkItemInput;
|
|
265
|
+
};
|
|
266
|
+
role: string;
|
|
267
|
+
session: WorkItemSessionInput;
|
|
268
|
+
resourceId: string;
|
|
269
|
+
kickoffKey: string;
|
|
270
|
+
kickoffMessage: string | null;
|
|
271
|
+
}
|
|
272
|
+
export interface PrepareFactoryRunStartResult {
|
|
273
|
+
item: WorkItemRow;
|
|
274
|
+
binding: FactoryRunBindingRecord;
|
|
275
|
+
pendingStart: FactoryPendingStartRecord;
|
|
276
|
+
replayed: boolean;
|
|
277
|
+
}
|
|
278
|
+
/** Session ref as accepted from clients — `startedBy` is stamped server-side. */
|
|
279
|
+
export interface WorkItemSessionInput {
|
|
280
|
+
sessionId: string;
|
|
281
|
+
branch: string;
|
|
282
|
+
threadId: string;
|
|
283
|
+
}
|
|
284
|
+
export type WorkItemSessions = Record<string, WorkItemSessionRef>;
|
|
285
|
+
export interface WorkItemRow {
|
|
286
|
+
id: string;
|
|
287
|
+
orgId: string;
|
|
288
|
+
factoryProjectId: string;
|
|
289
|
+
externalSource: ExternalWorkItemSource | null;
|
|
290
|
+
parentWorkItemId: string | null;
|
|
291
|
+
title: string;
|
|
292
|
+
stages: WorkItemStage[];
|
|
293
|
+
stageHistory: WorkItemStageEntry[];
|
|
294
|
+
sessions: WorkItemSessions;
|
|
295
|
+
metadata: Record<string, unknown> | null;
|
|
296
|
+
revision: number;
|
|
297
|
+
createdBy: string;
|
|
298
|
+
createdAt: Date;
|
|
299
|
+
updatedAt: Date;
|
|
300
|
+
}
|
|
301
|
+
export interface CreateWorkItemInput {
|
|
302
|
+
externalSource?: ExternalWorkItemSource | null;
|
|
303
|
+
parentWorkItemId?: string | null;
|
|
304
|
+
title: string;
|
|
305
|
+
stages?: WorkItemStage[];
|
|
306
|
+
sessions?: Record<string, WorkItemSessionInput>;
|
|
307
|
+
metadata?: Record<string, unknown> | null;
|
|
308
|
+
}
|
|
309
|
+
export interface UpdateWorkItemInput {
|
|
310
|
+
parentWorkItemId?: string | null;
|
|
311
|
+
title?: string;
|
|
312
|
+
stages?: WorkItemStage[];
|
|
313
|
+
sessions?: Record<string, WorkItemSessionInput>;
|
|
314
|
+
metadata?: Record<string, unknown> | null;
|
|
315
|
+
}
|
|
316
|
+
export interface WorkItemPriorState {
|
|
317
|
+
stages: WorkItemStage[];
|
|
318
|
+
sessionRoles: string[];
|
|
319
|
+
}
|
|
320
|
+
export interface UpsertWorkItemResult {
|
|
321
|
+
item: WorkItemRow;
|
|
322
|
+
created: boolean;
|
|
323
|
+
previous: WorkItemPriorState;
|
|
324
|
+
}
|
|
325
|
+
export declare const WORK_ITEMS_SCHEMA: CollectionSchema;
|
|
326
|
+
export declare class WorkItemRelationError extends Error {
|
|
327
|
+
readonly code = "invalid_work_item_relation";
|
|
328
|
+
}
|
|
329
|
+
export declare function validateParentRelation(projectItems: WorkItemRow[], itemId: string | undefined, parentWorkItemId: string | null): void;
|
|
330
|
+
/**
|
|
331
|
+
* Diff `oldStages` → `newStages` and return the updated history: exited stages
|
|
332
|
+
* get `exitedAt` + `exitedBy` stamped on their open entry, entered stages get
|
|
333
|
+
* a new entry.
|
|
334
|
+
*/
|
|
335
|
+
export declare function applyStageTransition(history: WorkItemStageEntry[], oldStages: WorkItemStage[], newStages: WorkItemStage[], by: string, now: Date): WorkItemStageEntry[];
|
|
336
|
+
export declare function stampSessions(sessions: Record<string, WorkItemSessionInput>, by: string): WorkItemSessions;
|
|
337
|
+
export declare class WorkItemsStorage extends FactoryStorageDomain {
|
|
338
|
+
#private;
|
|
339
|
+
constructor();
|
|
340
|
+
init(): Promise<void>;
|
|
341
|
+
dangerouslyClearAll(): Promise<void>;
|
|
342
|
+
/** List the org's work items for a project, newest first. */
|
|
343
|
+
list({ orgId, factoryProjectId }: {
|
|
344
|
+
orgId: string;
|
|
345
|
+
factoryProjectId: string;
|
|
346
|
+
}): Promise<WorkItemRow[]>;
|
|
347
|
+
get({ orgId, id }: {
|
|
348
|
+
orgId: string;
|
|
349
|
+
id: string;
|
|
350
|
+
}): Promise<WorkItemRow | null>;
|
|
351
|
+
getForProject(orgId: string, factoryProjectId: string, id: string): Promise<WorkItemRow | null>;
|
|
352
|
+
getTransitionResultByIngress(orgId: string, factoryProjectId: string, identity: string): Promise<Record<string, unknown> | null>;
|
|
353
|
+
commitTransition(input: CommitFactoryTransitionInput): Promise<CommitFactoryTransitionResult>;
|
|
354
|
+
commitRuleEvaluation(input: CommitFactoryRuleEvaluationInput): Promise<CommitFactoryRuleEvaluationResult>;
|
|
355
|
+
getToolResultCursor(orgId: string, factoryProjectId: string, bindingId: string): Promise<FactoryToolResultCursorRecord | null>;
|
|
356
|
+
advanceToolResultCursor(cursor: FactoryToolResultCursorRecord): Promise<void>;
|
|
357
|
+
listDeferredDecisions(orgId: string, factoryProjectId: string): Promise<FactoryDeferredDecisionRecord[]>;
|
|
358
|
+
/** Read a bounded newest-first status page without exposing another tenant. */
|
|
359
|
+
listDeferredDecisionPage(input: FactoryDeferredDecisionPageInput): Promise<FactoryDeferredDecisionPage>;
|
|
360
|
+
claimDeferredDecisions(input: FactoryLeaseClaimInput): Promise<FactoryDeferredDecisionRecord[]>;
|
|
361
|
+
renewDeferredDecisionLease(identity: FactoryLeaseIdentity, leaseExpiresAt: Date): Promise<boolean>;
|
|
362
|
+
completeDeferredDecision(identity: FactoryLeaseIdentity, now: Date): Promise<FactoryDeferredDecisionRecord | null>;
|
|
363
|
+
failDeferredDecision(input: FactoryDispatchFailureInput): Promise<FactoryDeferredDecisionRecord | null>;
|
|
364
|
+
/** Requeue the same idempotent terminal effect; non-failed decisions are never rerun. */
|
|
365
|
+
retryDeferredDecision(orgId: string, factoryProjectId: string, decisionId: string, now: Date): Promise<FactoryDeferredDecisionRecord | null>;
|
|
366
|
+
/** Resolve exact active agent authority; partial session matches never authorize. */
|
|
367
|
+
findActiveRunBinding(address: FactoryRunBindingAddress): Promise<FactoryRunBindingRecord | null>;
|
|
368
|
+
/** Resolve exact bound-session state for processor awareness; ambiguous cross-tenant matches return null. */
|
|
369
|
+
findRunBindingBySession(address: FactoryRunBindingSessionAddress): Promise<FactoryRunBindingRecord | null>;
|
|
370
|
+
/** Revoke one exact tenant-scoped binding. */
|
|
371
|
+
revokeRunBinding(input: RevokeFactoryRunBindingInput): Promise<FactoryRunBindingRecord | null>;
|
|
372
|
+
/** Enumerate active bindings for the server-owned restart reconciler. */
|
|
373
|
+
listActiveRunBindings(): Promise<FactoryRunBindingRecord[]>;
|
|
374
|
+
/** List binding history, optionally narrowed to one work item. */
|
|
375
|
+
listRunBindings(orgId: string, factoryProjectId: string, workItemId?: string): Promise<FactoryRunBindingRecord[]>;
|
|
376
|
+
listPendingStarts(orgId: string, factoryProjectId: string): Promise<FactoryPendingStartRecord[]>;
|
|
377
|
+
claimPendingStarts(input: FactoryLeaseClaimInput): Promise<FactoryPendingStartRecord[]>;
|
|
378
|
+
renewPendingStartLease(identity: FactoryLeaseIdentity, leaseExpiresAt: Date): Promise<boolean>;
|
|
379
|
+
completePendingStart(identity: FactoryLeaseIdentity, now: Date): Promise<FactoryPendingStartRecord | null>;
|
|
380
|
+
failPendingStart(input: FactoryDispatchFailureInput): Promise<FactoryPendingStartRecord | null>;
|
|
381
|
+
prepareRunStart(input: PrepareFactoryRunStartInput): Promise<PrepareFactoryRunStartResult>;
|
|
382
|
+
markPendingStart(bindingId: string, status: 'sent' | 'failed', lastError?: string): Promise<FactoryPendingStartRecord | null>;
|
|
383
|
+
/**
|
|
384
|
+
* Create a work item, reusing the existing record when `sourceKey` already
|
|
385
|
+
* has one for the project (acting twice on the same issue must not duplicate
|
|
386
|
+
* the card). On reuse the provided stages replace the current ones (with the
|
|
387
|
+
* transition recorded in history) and sessions/metadata are merged in. The
|
|
388
|
+
* result discriminates insert from reuse so callers can audit the actual
|
|
389
|
+
* outcome.
|
|
390
|
+
*/
|
|
391
|
+
upsert(params: {
|
|
392
|
+
orgId: string;
|
|
393
|
+
userId: string;
|
|
394
|
+
factoryProjectId: string;
|
|
395
|
+
input: CreateWorkItemInput;
|
|
396
|
+
reuseMode?: 'update' | 'preserve' | 'non-stage';
|
|
397
|
+
}): Promise<UpsertWorkItemResult>;
|
|
398
|
+
update({ orgId, id, userId, patch, }: {
|
|
399
|
+
orgId: string;
|
|
400
|
+
id: string;
|
|
401
|
+
userId: string;
|
|
402
|
+
patch: UpdateWorkItemInput;
|
|
403
|
+
}): Promise<{
|
|
404
|
+
item: WorkItemRow;
|
|
405
|
+
previous: WorkItemPriorState;
|
|
406
|
+
} | null>;
|
|
407
|
+
delete({ orgId, id }: {
|
|
408
|
+
orgId: string;
|
|
409
|
+
id: string;
|
|
410
|
+
}): Promise<WorkItemRow | null>;
|
|
411
|
+
}
|
|
412
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +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,EAAqB,MAAM,sBAAsB,CAAC;AAEhF,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,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAA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