@mastra/factory 0.28.0-alpha.9 → 0.29.0-alpha.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 +67 -46
- package/dist/boards/board-writes.d.ts +3 -3
- package/dist/boards/board-writes.d.ts.map +1 -1
- package/dist/boards/board-writes.js +24 -20
- package/dist/boards/board-writes.js.map +1 -1
- package/dist/boards/project-boards.d.ts +20 -0
- package/dist/boards/project-boards.d.ts.map +1 -1
- package/dist/boards/project-boards.js +35 -11
- package/dist/boards/project-boards.js.map +1 -1
- package/dist/boards/registry.d.ts.map +1 -1
- package/dist/boards/registry.js +0 -3
- package/dist/boards/registry.js.map +1 -1
- package/dist/boards/reroute.d.ts +31 -0
- package/dist/boards/reroute.d.ts.map +1 -0
- package/dist/boards/reroute.js +71 -0
- package/dist/boards/reroute.js.map +1 -0
- package/dist/capabilities/version-control.d.ts +6 -1
- package/dist/capabilities/version-control.d.ts.map +1 -1
- package/dist/environment/build-runner.d.ts +13 -2
- package/dist/environment/build-runner.d.ts.map +1 -1
- package/dist/environment/build-runner.js +42 -0
- package/dist/environment/build-runner.js.map +1 -1
- package/dist/environment/build-schedule.js +1 -1
- package/dist/environment/build-schedule.js.map +1 -1
- package/dist/environment/build-workflow.d.ts +6 -4
- package/dist/environment/build-workflow.d.ts.map +1 -1
- package/dist/environment/build-workflow.js +70 -66
- package/dist/environment/build-workflow.js.map +1 -1
- package/dist/environment/build.d.ts +22 -7
- package/dist/environment/build.d.ts.map +1 -1
- package/dist/environment/build.js +73 -15
- package/dist/environment/build.js.map +1 -1
- package/dist/environment/heads.d.ts +1 -1
- package/dist/environment/heads.d.ts.map +1 -1
- package/dist/environment/heads.js +4 -1
- package/dist/environment/heads.js.map +1 -1
- package/dist/environment/repository-access.d.ts +15 -0
- package/dist/environment/repository-access.d.ts.map +1 -0
- package/dist/environment/repository-access.js +60 -0
- package/dist/environment/repository-access.js.map +1 -0
- package/dist/factory.d.ts +5 -2
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +40 -30
- package/dist/factory.js.map +1 -1
- package/dist/integrations/base.d.ts +8 -0
- package/dist/integrations/base.d.ts.map +1 -1
- package/dist/integrations/dependabot/default-rules.d.ts +38 -0
- package/dist/integrations/dependabot/default-rules.d.ts.map +1 -0
- package/dist/integrations/dependabot/default-rules.js +63 -0
- package/dist/integrations/dependabot/default-rules.js.map +1 -0
- package/dist/integrations/dependabot/rules.d.ts +42 -0
- package/dist/integrations/dependabot/rules.d.ts.map +1 -0
- package/dist/integrations/dependabot/rules.js +187 -0
- package/dist/integrations/dependabot/rules.js.map +1 -0
- package/dist/integrations/dependabot/sync.d.ts +76 -0
- package/dist/integrations/dependabot/sync.d.ts.map +1 -0
- package/dist/integrations/dependabot/sync.js +111 -0
- package/dist/integrations/dependabot/sync.js.map +1 -0
- package/dist/integrations/github/routes.d.ts.map +1 -1
- package/dist/integrations/github/routes.js +7 -2
- package/dist/integrations/github/routes.js.map +1 -1
- package/dist/integrations/github/sandbox-release.d.ts +12 -0
- package/dist/integrations/github/sandbox-release.d.ts.map +1 -1
- package/dist/integrations/github/sandbox-release.js +16 -1
- package/dist/integrations/github/sandbox-release.js.map +1 -1
- package/dist/integrations/github/sandbox.d.ts +12 -0
- package/dist/integrations/github/sandbox.d.ts.map +1 -1
- package/dist/integrations/github/sandbox.js +22 -1
- package/dist/integrations/github/sandbox.js.map +1 -1
- package/dist/integrations/platform/connect/routes.d.ts.map +1 -1
- package/dist/integrations/platform/connect/routes.js +4 -0
- package/dist/integrations/platform/connect/routes.js.map +1 -1
- package/dist/integrations/platform/github/event-worker.d.ts +5 -0
- package/dist/integrations/platform/github/event-worker.d.ts.map +1 -1
- package/dist/integrations/platform/github/event-worker.js +33 -2
- package/dist/integrations/platform/github/event-worker.js.map +1 -1
- package/dist/integrations/platform/github/integration.d.ts +19 -1
- package/dist/integrations/platform/github/integration.d.ts.map +1 -1
- package/dist/integrations/platform/github/integration.js +183 -105
- package/dist/integrations/platform/github/integration.js.map +1 -1
- package/dist/integrations/platform/jira/integration.d.ts.map +1 -1
- package/dist/integrations/platform/jira/integration.js +5 -1
- package/dist/integrations/platform/jira/integration.js.map +1 -1
- package/dist/integrations/platform/vanta/integration.d.ts +33 -0
- package/dist/integrations/platform/vanta/integration.d.ts.map +1 -0
- package/dist/integrations/platform/vanta/integration.js +133 -0
- package/dist/integrations/platform/vanta/integration.js.map +1 -0
- package/dist/integrations/slack/integration.d.ts.map +1 -1
- package/dist/integrations/slack/integration.js +7 -4
- package/dist/integrations/slack/integration.js.map +1 -1
- package/dist/integrations/vanta/default-rules.d.ts +34 -0
- package/dist/integrations/vanta/default-rules.d.ts.map +1 -0
- package/dist/integrations/vanta/default-rules.js +61 -0
- package/dist/integrations/vanta/default-rules.js.map +1 -0
- package/dist/integrations/vanta/rules.d.ts +40 -0
- package/dist/integrations/vanta/rules.d.ts.map +1 -0
- package/dist/integrations/vanta/rules.js +208 -0
- package/dist/integrations/vanta/rules.js.map +1 -0
- package/dist/integrations/vanta/sync.d.ts +36 -0
- package/dist/integrations/vanta/sync.d.ts.map +1 -0
- package/dist/integrations/vanta/sync.js +73 -0
- package/dist/integrations/vanta/sync.js.map +1 -0
- package/dist/mcp/routes.d.ts.map +1 -1
- package/dist/mcp/routes.js +3 -5
- package/dist/mcp/routes.js.map +1 -1
- package/dist/routes/board-snapshot.d.ts +24 -1
- package/dist/routes/board-snapshot.d.ts.map +1 -1
- package/dist/routes/board-snapshot.js +75 -7
- package/dist/routes/board-snapshot.js.map +1 -1
- package/dist/routes/boards.d.ts +2 -3
- package/dist/routes/boards.d.ts.map +1 -1
- package/dist/routes/boards.js.map +1 -1
- package/dist/routes/contracts.d.ts +307 -0
- package/dist/routes/contracts.d.ts.map +1 -1
- package/dist/routes/contracts.js +253 -9
- package/dist/routes/contracts.js.map +1 -1
- package/dist/routes/intake-routes.d.ts +3 -0
- package/dist/routes/intake-routes.d.ts.map +1 -1
- package/dist/routes/intake-routes.js +44 -0
- package/dist/routes/intake-routes.js.map +1 -1
- package/dist/routes/knowledge.d.ts.map +1 -1
- package/dist/routes/knowledge.js +3 -2
- package/dist/routes/knowledge.js.map +1 -1
- package/dist/routes/projects.d.ts.map +1 -1
- package/dist/routes/projects.js +5 -0
- package/dist/routes/projects.js.map +1 -1
- package/dist/routes/sandbox-envs.d.ts +2 -0
- package/dist/routes/sandbox-envs.d.ts.map +1 -1
- package/dist/routes/sandbox-envs.js +3 -0
- package/dist/routes/sandbox-envs.js.map +1 -1
- package/dist/routes/source-control-sessions.d.ts +1 -1
- package/dist/routes/source-control-sessions.d.ts.map +1 -1
- package/dist/routes/source-control-sessions.js +109 -3
- package/dist/routes/source-control-sessions.js.map +1 -1
- package/dist/routes/source-control-settings.d.ts +2 -0
- package/dist/routes/source-control-settings.d.ts.map +1 -1
- package/dist/routes/source-control-settings.js +5 -0
- package/dist/routes/source-control-settings.js.map +1 -1
- package/dist/routes/surface.d.ts +8 -1
- package/dist/routes/surface.d.ts.map +1 -1
- package/dist/routes/surface.js +74 -10
- package/dist/routes/surface.js.map +1 -1
- package/dist/routes/work-item-activity.d.ts +11 -0
- package/dist/routes/work-item-activity.d.ts.map +1 -0
- package/dist/routes/work-item-activity.js +25 -0
- package/dist/routes/work-item-activity.js.map +1 -0
- package/dist/routes/work-item-selection.d.ts +14 -0
- package/dist/routes/work-item-selection.d.ts.map +1 -0
- package/dist/routes/work-item-selection.js +44 -0
- package/dist/routes/work-item-selection.js.map +1 -0
- package/dist/routes/work-item-starters.d.ts +29 -0
- package/dist/routes/work-item-starters.d.ts.map +1 -0
- package/dist/routes/work-item-starters.js +152 -0
- package/dist/routes/work-item-starters.js.map +1 -0
- package/dist/routes/work-items.d.ts.map +1 -1
- package/dist/routes/work-items.js +239 -16
- package/dist/routes/work-items.js.map +1 -1
- package/dist/rules/dispatch-errors.d.ts +3 -0
- package/dist/rules/dispatch-errors.d.ts.map +1 -1
- package/dist/rules/dispatch-errors.js +9 -0
- package/dist/rules/dispatch-errors.js.map +1 -1
- package/dist/rules/dispatcher.d.ts +4 -1
- package/dist/rules/dispatcher.d.ts.map +1 -1
- package/dist/rules/dispatcher.js +122 -33
- package/dist/rules/dispatcher.js.map +1 -1
- package/dist/rules/index.d.ts +2 -2
- package/dist/rules/index.d.ts.map +1 -1
- package/dist/rules/index.js +2 -2
- package/dist/rules/processor.d.ts +2 -0
- package/dist/rules/processor.d.ts.map +1 -1
- package/dist/rules/processor.js +18 -4
- package/dist/rules/processor.js.map +1 -1
- package/dist/rules/start-coordinator.d.ts +6 -1
- package/dist/rules/start-coordinator.d.ts.map +1 -1
- package/dist/rules/start-coordinator.js +6 -2
- package/dist/rules/start-coordinator.js.map +1 -1
- package/dist/rules/transition-service.d.ts +20 -2
- package/dist/rules/transition-service.d.ts.map +1 -1
- package/dist/rules/transition-service.js +43 -20
- package/dist/rules/transition-service.js.map +1 -1
- package/dist/rules/types.d.ts +71 -3
- package/dist/rules/types.d.ts.map +1 -1
- package/dist/rules/types.js +10 -2
- package/dist/rules/types.js.map +1 -1
- package/dist/rules/validation.d.ts.map +1 -1
- package/dist/rules/validation.js +5 -0
- package/dist/rules/validation.js.map +1 -1
- package/dist/sandbox/context-sandboxes.d.ts +70 -0
- package/dist/sandbox/context-sandboxes.d.ts.map +1 -0
- package/dist/sandbox/context-sandboxes.js +120 -0
- package/dist/sandbox/context-sandboxes.js.map +1 -0
- package/dist/sandbox/session-retirement.d.ts +11 -4
- package/dist/sandbox/session-retirement.d.ts.map +1 -1
- package/dist/sandbox/session-retirement.js +39 -13
- package/dist/sandbox/session-retirement.js.map +1 -1
- package/dist/session/factory-session.d.ts +20 -5
- package/dist/session/factory-session.d.ts.map +1 -1
- package/dist/session/factory-session.js +20 -6
- package/dist/session/factory-session.js.map +1 -1
- package/dist/session/live-sessions.d.ts +1 -1
- package/dist/session/live-sessions.d.ts.map +1 -1
- package/dist/session/live-sessions.js +12 -2
- package/dist/session/live-sessions.js.map +1 -1
- package/dist/storage/domains/audit/actions.d.ts +1 -1
- package/dist/storage/domains/audit/actions.d.ts.map +1 -1
- package/dist/storage/domains/audit/actions.js +2 -1
- package/dist/storage/domains/audit/actions.js.map +1 -1
- package/dist/storage/domains/audit/actors.d.ts.map +1 -1
- package/dist/storage/domains/audit/actors.js +1 -1
- package/dist/storage/domains/audit/actors.js.map +1 -1
- package/dist/storage/domains/boards/base.d.ts +25 -5
- package/dist/storage/domains/boards/base.d.ts.map +1 -1
- package/dist/storage/domains/boards/base.js +57 -20
- package/dist/storage/domains/boards/base.js.map +1 -1
- package/dist/storage/domains/intake/base.d.ts +1 -1
- package/dist/storage/domains/intake/base.js +2 -2
- package/dist/storage/domains/intake/base.js.map +1 -1
- package/dist/storage/domains/projects/base.d.ts +16 -2
- package/dist/storage/domains/projects/base.d.ts.map +1 -1
- package/dist/storage/domains/projects/base.js +32 -5
- package/dist/storage/domains/projects/base.js.map +1 -1
- package/dist/storage/domains/work-items/base.d.ts +60 -8
- package/dist/storage/domains/work-items/base.d.ts.map +1 -1
- package/dist/storage/domains/work-items/base.js +180 -18
- package/dist/storage/domains/work-items/base.js.map +1 -1
- package/dist/storage/domains/work-items/cards.d.ts +1 -0
- package/dist/storage/domains/work-items/cards.d.ts.map +1 -1
- package/dist/storage/domains/work-items/cards.js +32 -8
- package/dist/storage/domains/work-items/cards.js.map +1 -1
- package/dist/storage/domains/work-items/legacy-review.d.ts +19 -1
- package/dist/storage/domains/work-items/legacy-review.d.ts.map +1 -1
- package/dist/storage/domains/work-items/legacy-review.js +62 -3
- package/dist/storage/domains/work-items/legacy-review.js.map +1 -1
- package/dist/storage/domains/work-items/work-item-schema.d.ts +1 -0
- package/dist/storage/domains/work-items/work-item-schema.d.ts.map +1 -1
- package/dist/storage/domains/work-items/work-item-schema.js +46 -18
- package/dist/storage/domains/work-items/work-item-schema.js.map +1 -1
- package/dist/tools/annotations.d.ts.map +1 -1
- package/dist/tools/annotations.js +4 -0
- package/dist/tools/annotations.js.map +1 -1
- package/dist/tools/approval-tools.d.ts +20 -0
- package/dist/tools/approval-tools.d.ts.map +1 -1
- package/dist/tools/approval-tools.js +79 -30
- package/dist/tools/approval-tools.js.map +1 -1
- package/dist/tools/audit-events-tool.d.ts +29 -0
- package/dist/tools/audit-events-tool.d.ts.map +1 -0
- package/dist/tools/audit-events-tool.js +180 -0
- package/dist/tools/audit-events-tool.js.map +1 -0
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/messaging-tools.d.ts.map +1 -1
- package/dist/tools/messaging-tools.js +1 -1
- package/dist/tools/messaging-tools.js.map +1 -1
- package/dist/tools/permissions.d.ts.map +1 -1
- package/dist/tools/permissions.js +1 -0
- package/dist/tools/permissions.js.map +1 -1
- package/dist/tools/read-tools.d.ts +0 -2
- package/dist/tools/read-tools.d.ts.map +1 -1
- package/dist/tools/read-tools.js +2 -7
- package/dist/tools/read-tools.js.map +1 -1
- package/dist/tools/reports.d.ts +3 -0
- package/dist/tools/reports.d.ts.map +1 -1
- package/dist/tools/reports.js +3 -3
- package/dist/tools/reports.js.map +1 -1
- package/dist/tools/run-watch.d.ts +14 -2
- package/dist/tools/run-watch.d.ts.map +1 -1
- package/dist/tools/run-watch.js +24 -4
- package/dist/tools/run-watch.js.map +1 -1
- package/dist/tools/session-tools.d.ts.map +1 -1
- package/dist/tools/session-tools.js +17 -6
- package/dist/tools/session-tools.js.map +1 -1
- package/dist/tools/sessions-state-processor.js +1 -1
- package/dist/tools/sessions-state-processor.js.map +1 -1
- package/dist/tools/side-sessions.d.ts.map +1 -1
- package/dist/tools/side-sessions.js +1 -1
- package/dist/tools/side-sessions.js.map +1 -1
- package/dist/tools/work-item-tools.d.ts.map +1 -1
- package/dist/tools/work-item-tools.js +12 -2
- package/dist/tools/work-item-tools.js.map +1 -1
- package/dist/work-item-branch.d.ts +1 -1
- package/dist/work-item-branch.d.ts.map +1 -1
- package/dist/work-item-branch.js +2 -0
- package/dist/work-item-branch.js.map +1 -1
- package/dist/work-items/board-check.d.ts +11 -0
- package/dist/work-items/board-check.d.ts.map +1 -0
- package/dist/work-items/board-check.js +20 -0
- package/dist/work-items/board-check.js.map +1 -0
- package/dist/work-items/board-filter-options.d.ts +5 -0
- package/dist/work-items/board-filter-options.d.ts.map +1 -0
- package/dist/work-items/board-filter-options.js +27 -0
- package/dist/work-items/board-filter-options.js.map +1 -0
- package/dist/work-items/board-phases.d.ts +28 -0
- package/dist/work-items/board-phases.d.ts.map +1 -0
- package/dist/work-items/board-phases.js +165 -0
- package/dist/work-items/board-phases.js.map +1 -0
- package/dist/work-items/card-facts.d.ts +24 -0
- package/dist/work-items/card-facts.d.ts.map +1 -0
- package/dist/work-items/card-facts.js +75 -0
- package/dist/work-items/card-facts.js.map +1 -0
- package/dist/work-items/card-labels.d.ts +5 -0
- package/dist/work-items/card-labels.d.ts.map +1 -0
- package/dist/work-items/card-labels.js +13 -0
- package/dist/work-items/card-labels.js.map +1 -0
- package/dist/work-items/card-number.d.ts +10 -0
- package/dist/work-items/card-number.d.ts.map +1 -0
- package/dist/work-items/card-number.js +15 -0
- package/dist/work-items/card-number.js.map +1 -0
- package/dist/work-items/card-people.d.ts +25 -0
- package/dist/work-items/card-people.d.ts.map +1 -0
- package/dist/work-items/card-people.js +100 -0
- package/dist/work-items/card-people.js.map +1 -0
- package/dist/work-items/card-search-text.d.ts +4 -0
- package/dist/work-items/card-search-text.d.ts.map +1 -0
- package/dist/work-items/card-search-text.js +15 -0
- package/dist/work-items/card-search-text.js.map +1 -0
- package/dist/work-items/card-source-filters.d.ts +23 -0
- package/dist/work-items/card-source-filters.d.ts.map +1 -0
- package/dist/work-items/card-source-filters.js +25 -0
- package/dist/work-items/card-source-filters.js.map +1 -0
- package/dist/work-items/create-work-item.d.ts +0 -6
- package/dist/work-items/create-work-item.d.ts.map +1 -1
- package/dist/work-items/create-work-item.js +2 -7
- package/dist/work-items/create-work-item.js.map +1 -1
- package/dist/work-items/list-related-cards.d.ts +4 -0
- package/dist/work-items/list-related-cards.d.ts.map +1 -0
- package/dist/work-items/list-related-cards.js +24 -0
- package/dist/work-items/list-related-cards.js.map +1 -0
- package/dist/work-items/related-cards.d.ts +21 -0
- package/dist/work-items/related-cards.d.ts.map +1 -0
- package/dist/work-items/related-cards.js +45 -0
- package/dist/work-items/related-cards.js.map +1 -0
- package/dist/work-items/search-words.d.ts +5 -0
- package/dist/work-items/search-words.d.ts.map +1 -0
- package/dist/work-items/search-words.js +12 -0
- package/dist/work-items/search-words.js.map +1 -0
- package/dist/work-items/split-migration.d.ts.map +1 -1
- package/dist/work-items/split-migration.js +6 -2
- package/dist/work-items/split-migration.js.map +1 -1
- package/dist/workspace.d.ts +0 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +140 -78
- package/dist/workspace.js.map +1 -1
- package/factory-skills/factory-build/SKILL.md +1 -1
- package/factory-skills/factory-self-review/SKILL.md +1 -1
- package/factory-skills/factory-triage/SKILL.md +4 -4
- package/package.json +17 -16
package/dist/routes/contracts.js
CHANGED
|
@@ -71,11 +71,11 @@ const intakeRoutePathSchema = z.object({
|
|
|
71
71
|
id: uuidSchema,
|
|
72
72
|
routeId: uuidSchema
|
|
73
73
|
});
|
|
74
|
-
const
|
|
74
|
+
const boardIdentifierSchema = z.string().max(128).regex(BOARD_IDENTIFIER_RE);
|
|
75
75
|
const intakeRouteTargetSchema = z.object({
|
|
76
|
-
boardKey:
|
|
76
|
+
boardKey: boardIdentifierSchema,
|
|
77
77
|
/** Unset lands the card in the board's first phase. */
|
|
78
|
-
phaseKey:
|
|
78
|
+
phaseKey: boardIdentifierSchema.nullable().optional(),
|
|
79
79
|
/**
|
|
80
80
|
* File a pull request on the card of the issue it closes (on `boardKey`) instead of a new card;
|
|
81
81
|
* that card moves to `phaseKey` when its board allows it. Matches no other arrival.
|
|
@@ -146,6 +146,18 @@ const intakeRouteListResponseSchema = z.object({
|
|
|
146
146
|
/** Whether the caller may add, edit, reorder, or delete routes. */
|
|
147
147
|
canEdit: z.boolean()
|
|
148
148
|
});
|
|
149
|
+
const intakeRerouteResponseSchema = z.object({
|
|
150
|
+
total: z.number().int(),
|
|
151
|
+
moves: z.array(z.object({
|
|
152
|
+
fromBoard: z.string(),
|
|
153
|
+
toBoard: z.string(),
|
|
154
|
+
count: z.number().int()
|
|
155
|
+
}))
|
|
156
|
+
});
|
|
157
|
+
const intakeRerouteApplyResponseSchema = z.object({
|
|
158
|
+
moved: z.number().int(),
|
|
159
|
+
skipped: z.number().int()
|
|
160
|
+
});
|
|
149
161
|
const workItemPathSchema = z.object({ id: uuidSchema });
|
|
150
162
|
const transitionPathSchema = z.object({
|
|
151
163
|
id: uuidSchema,
|
|
@@ -380,6 +392,188 @@ const sessionSchema = z.object({
|
|
|
380
392
|
branch: z.string().min(1).max(512),
|
|
381
393
|
threadId: z.string().min(1).max(512)
|
|
382
394
|
});
|
|
395
|
+
const boundedLimitSchema = (defaultValue, max) => z.string().optional().transform((value) => {
|
|
396
|
+
const parsed = value ? Number.parseInt(value, 10) : defaultValue;
|
|
397
|
+
return Number.isFinite(parsed) ? Math.max(1, Math.min(max, parsed)) : defaultValue;
|
|
398
|
+
});
|
|
399
|
+
/** Without `sessionId`, `scope`, `started`, `source` or `workItemId`, the list is the whole board. */
|
|
400
|
+
const workItemListQuerySchema = z.object({
|
|
401
|
+
/** Repeatable. Narrows the list to the cards that hold these sessions and the cards related to them. */
|
|
402
|
+
sessionId: z.array(sessionSchema.shape.sessionId).optional(),
|
|
403
|
+
/** `sessions` narrows the list to the cards that hold any session and the cards related to them. */
|
|
404
|
+
scope: z.enum(["sessions"]).optional(),
|
|
405
|
+
/** `false` narrows the list to the cards that hold no session, most recently updated first. */
|
|
406
|
+
started: z.enum(["false"]).optional(),
|
|
407
|
+
/** With `started=false`: words that must all be in the card's title, key, number or source id. */
|
|
408
|
+
q: z.string().max(200).optional(),
|
|
409
|
+
/** With `started=false`: how many cards to send. */
|
|
410
|
+
limit: boundedLimitSchema(20, 50),
|
|
411
|
+
/** Repeatable. Narrows the list to the cards filed from these sources, each named by its id or its URL. */
|
|
412
|
+
source: z.array(z.string().min(1).max(512)).min(1).max(100).optional(),
|
|
413
|
+
/**
|
|
414
|
+
* Repeatable. Narrows the list to the cards with these ids; an id no card has lists nothing.
|
|
415
|
+
* Each card comes with the `version` the phases read names it by.
|
|
416
|
+
*/
|
|
417
|
+
workItemId: z.array(uuidSchema).min(1).max(100).optional(),
|
|
418
|
+
/**
|
|
419
|
+
* The `cursor` of the whole board this reader holds: the answer is then what moved since. One
|
|
420
|
+
* this server did not issue reads as none, and the board answers whole.
|
|
421
|
+
*/
|
|
422
|
+
since: z.string().regex(/^\d{1,15}$/).optional().catch(void 0)
|
|
423
|
+
}).refine((query) => !(query.scope && query.sessionId), {
|
|
424
|
+
path: ["scope"],
|
|
425
|
+
message: "Send scope or sessionId, not both"
|
|
426
|
+
}).refine((query) => !(query.started && (query.scope || query.sessionId)), {
|
|
427
|
+
path: ["started"],
|
|
428
|
+
message: "Send started without scope or sessionId"
|
|
429
|
+
}).refine((query) => query.q === void 0 || query.started !== void 0, {
|
|
430
|
+
path: ["q"],
|
|
431
|
+
message: "Send q only with started=false"
|
|
432
|
+
}).refine((query) => !(query.source && (query.started || query.scope || query.sessionId)), {
|
|
433
|
+
path: ["source"],
|
|
434
|
+
message: "Send source without started, scope or sessionId"
|
|
435
|
+
}).refine((query) => !(query.workItemId && (query.source || query.started || query.scope || query.sessionId)), {
|
|
436
|
+
path: ["workItemId"],
|
|
437
|
+
message: "Send workItemId without source, started, scope or sessionId"
|
|
438
|
+
}).transform((query) => query.sessionId || query.scope || query.started || query.source || query.workItemId ? {
|
|
439
|
+
...query,
|
|
440
|
+
since: void 0
|
|
441
|
+
} : query);
|
|
442
|
+
const countSchema = z.number().int().nonnegative();
|
|
443
|
+
/** What the draft page's starter buttons count on the project's default board. */
|
|
444
|
+
const workItemStartersResponseSchema = z.object({
|
|
445
|
+
failed: countSchema,
|
|
446
|
+
changesRequested: countSchema,
|
|
447
|
+
review: z.object({
|
|
448
|
+
count: countSchema,
|
|
449
|
+
oldestOpenedAt: z.string().optional()
|
|
450
|
+
}),
|
|
451
|
+
undecided: countSchema,
|
|
452
|
+
untriaged: countSchema,
|
|
453
|
+
unplannedBugs: countSchema,
|
|
454
|
+
sweep: z.object({
|
|
455
|
+
area: z.string(),
|
|
456
|
+
count: countSchema
|
|
457
|
+
}).optional(),
|
|
458
|
+
stale: countSchema
|
|
459
|
+
});
|
|
460
|
+
const workItemActivityQuerySchema = z.object({ since: z.iso.datetime({ offset: true }).transform((since) => Date.parse(since)) });
|
|
461
|
+
/** When the project's cards were created and completed since an instant, and how many cards it has in all. */
|
|
462
|
+
const workItemActivityResponseSchema = z.object({
|
|
463
|
+
total: countSchema,
|
|
464
|
+
createdAt: z.array(z.string()),
|
|
465
|
+
doneAt: z.array(z.string())
|
|
466
|
+
});
|
|
467
|
+
const BOARD_PHASES_SORTS = [
|
|
468
|
+
"recent",
|
|
469
|
+
"recent-mine",
|
|
470
|
+
"created-newest",
|
|
471
|
+
"created-oldest"
|
|
472
|
+
];
|
|
473
|
+
/** Repeatable. The values picked for one filter: a card matches on any of them, and none picks every card. */
|
|
474
|
+
const pickedValuesSchema = z.array(z.string().min(1).max(512)).max(100).default([]).transform((values) => new Set(values));
|
|
475
|
+
/** `<phase>:<count>`: how many cards of one phase to list. */
|
|
476
|
+
const phaseWindowSchema = z.string().transform((entry) => {
|
|
477
|
+
const colon = entry.lastIndexOf(":");
|
|
478
|
+
return [entry.slice(0, Math.max(colon, 0)), entry.slice(colon + 1)];
|
|
479
|
+
}).pipe(z.tuple([boardIdentifierSchema, z.string().regex(/^[1-9]\d{0,5}$/).transform(Number)]));
|
|
480
|
+
/** One view of a board: its order, its search and filters, and how deep each phase is listed. */
|
|
481
|
+
const boardPhasesQuerySchema = z.object({
|
|
482
|
+
/** `recent-mine` puts the cards the signed-in user last moved into the phase before the others. */
|
|
483
|
+
sort: z.enum(BOARD_PHASES_SORTS).default("recent"),
|
|
484
|
+
/** Words that must all be in the card's title, key, number or source id. */
|
|
485
|
+
q: z.string().max(200).optional(),
|
|
486
|
+
/** A provider (`github`, `linear`, `manual`…), or `pull-request` for every card that has one. */
|
|
487
|
+
source: pickedValuesSchema,
|
|
488
|
+
/** Linear project ids. Picked without `source`, they keep Linear cards only. */
|
|
489
|
+
linearProject: pickedValuesSchema,
|
|
490
|
+
/** A card matches when it carries every one of them. */
|
|
491
|
+
label: pickedValuesSchema,
|
|
492
|
+
/** Participant ids (`github:octocat`, `factory:<user id>`) related to the card in any way. */
|
|
493
|
+
teammate: pickedValuesSchema,
|
|
494
|
+
author: pickedValuesSchema,
|
|
495
|
+
assignee: pickedValuesSchema,
|
|
496
|
+
reviewer: pickedValuesSchema,
|
|
497
|
+
/** Factory users who created the card, moved it or started a session on it. */
|
|
498
|
+
worked: pickedValuesSchema,
|
|
499
|
+
/** How many cards each phase lists. */
|
|
500
|
+
limit: boundedLimitSchema(50, 200),
|
|
501
|
+
/**
|
|
502
|
+
* Repeatable `<phase>:<count>`: lists that phase's first `count` cards instead of `limit`.
|
|
503
|
+
* One for a phase the board does not have is ignored.
|
|
504
|
+
*/
|
|
505
|
+
window: z.array(phaseWindowSchema).max(64).default([]).refine((windows) => new Set(windows.map(([phase]) => phase)).size === windows.length, { message: "Send one window per phase" }).transform((windows) => new Map(windows)),
|
|
506
|
+
/**
|
|
507
|
+
* A card to answer for wherever it lies: the answer names it with its place in each phase, and
|
|
508
|
+
* `cards=true` sends its body. No phase is listed deeper for it.
|
|
509
|
+
*/
|
|
510
|
+
item: uuidSchema.optional(),
|
|
511
|
+
/** `true` also sends the body of every card the answer names. */
|
|
512
|
+
cards: z.enum(["true"]).optional()
|
|
513
|
+
});
|
|
514
|
+
/**
|
|
515
|
+
* Names a card and the body the answer was read from. `version` is another value whenever any of
|
|
516
|
+
* the body is, so a reader that holds the card at this version holds this body.
|
|
517
|
+
*/
|
|
518
|
+
const cardStampSchema = z.object({
|
|
519
|
+
id: z.string(),
|
|
520
|
+
version: z.string()
|
|
521
|
+
});
|
|
522
|
+
const boardPhasesResponseSchema = z.object({
|
|
523
|
+
/** The board's phases in declaration order. */
|
|
524
|
+
phases: z.array(z.object({
|
|
525
|
+
phase: z.string(),
|
|
526
|
+
/** Cards of this phase that match the view. */
|
|
527
|
+
total: countSchema,
|
|
528
|
+
/** The first of them in the view's order: what the reader shows. */
|
|
529
|
+
cards: z.array(cardStampSchema)
|
|
530
|
+
})),
|
|
531
|
+
/** With `item`: the asked card, when the board holds it. */
|
|
532
|
+
item: cardStampSchema.extend({
|
|
533
|
+
/**
|
|
534
|
+
* Each phase the view lists the card under, and how many cards it lists before it there.
|
|
535
|
+
* Empty when the search or filters leave the card out.
|
|
536
|
+
*/
|
|
537
|
+
places: z.array(z.object({
|
|
538
|
+
phase: z.string(),
|
|
539
|
+
position: countSchema
|
|
540
|
+
})) }).optional(),
|
|
541
|
+
/**
|
|
542
|
+
* Cards related to a listed card or to the asked one that no phase lists: the first `limit` of
|
|
543
|
+
* each card's, in the board's order.
|
|
544
|
+
*/
|
|
545
|
+
related: z.array(cardStampSchema),
|
|
546
|
+
/** How many such cards there are, named in `related` or not. */
|
|
547
|
+
relatedTotal: countSchema,
|
|
548
|
+
/** Cards of the board, whatever the search and filters. */
|
|
549
|
+
boardTotal: countSchema,
|
|
550
|
+
/** Cards of the board that match the view, each counted once: a card in two phases is one. */
|
|
551
|
+
matchingTotal: countSchema,
|
|
552
|
+
/** With `cards=true`: the body of every card named in `phases`, `item` and `related`, each with its `version`. */
|
|
553
|
+
workItems: z.array(cardSchema.extend({ version: z.string() })).optional(),
|
|
554
|
+
/** Among the named cards. */
|
|
555
|
+
runningSessionIds: z.array(z.string()),
|
|
556
|
+
parkedSessionIds: z.array(z.string())
|
|
557
|
+
});
|
|
558
|
+
/** What the board's filter menus offer, read over every card of the project. */
|
|
559
|
+
const workItemFilterOptionsResponseSchema = z.object({
|
|
560
|
+
/** Every label on a card, sorted. */
|
|
561
|
+
labels: z.array(z.string()),
|
|
562
|
+
/** The people the cards' sources name, sorted by name. `id` is what a people filter sends. */
|
|
563
|
+
people: z.array(z.object({
|
|
564
|
+
id: z.string(),
|
|
565
|
+
name: z.string(),
|
|
566
|
+
source: z.enum([
|
|
567
|
+
"github",
|
|
568
|
+
"gitlab",
|
|
569
|
+
"linear",
|
|
570
|
+
"jira",
|
|
571
|
+
"incidentio"
|
|
572
|
+
])
|
|
573
|
+
})),
|
|
574
|
+
/** The Factory users who created a card, moved one or started a session on one, sorted. */
|
|
575
|
+
actorIds: z.array(z.string())
|
|
576
|
+
});
|
|
383
577
|
const sessionsSchema = z.record(z.string().min(1).max(64), sessionSchema);
|
|
384
578
|
const metadataSchema = z.union([z.record(z.string(), z.unknown()), z.null()]).refine((value) => {
|
|
385
579
|
try {
|
|
@@ -460,10 +654,6 @@ const decisionStatusSchema = z.enum([
|
|
|
460
654
|
"succeeded",
|
|
461
655
|
"failed"
|
|
462
656
|
]);
|
|
463
|
-
const boundedLimitSchema = (defaultValue, max) => z.string().optional().transform((value) => {
|
|
464
|
-
const parsed = value ? Number.parseInt(value, 10) : defaultValue;
|
|
465
|
-
return Number.isFinite(parsed) ? Math.max(1, Math.min(max, parsed)) : defaultValue;
|
|
466
|
-
});
|
|
467
657
|
const decisionCursorSchema = z.string().optional().transform((value, context) => {
|
|
468
658
|
if (!value) return void 0;
|
|
469
659
|
try {
|
|
@@ -807,6 +997,14 @@ const FACTORY_ROUTE_CONTRACTS = {
|
|
|
807
997
|
pathSchema: boardPathSchema,
|
|
808
998
|
responseSchema: storedBoardResponseSchema
|
|
809
999
|
},
|
|
1000
|
+
boardPhases: {
|
|
1001
|
+
method: "GET",
|
|
1002
|
+
path: "/web/factory/projects/:id/boards/:boardKey/phases",
|
|
1003
|
+
description: "List the cards under each phase of a board view, in order, with how many match",
|
|
1004
|
+
pathSchema: boardPathSchema,
|
|
1005
|
+
querySchema: boardPhasesQuerySchema,
|
|
1006
|
+
responseSchema: boardPhasesResponseSchema
|
|
1007
|
+
},
|
|
810
1008
|
boardCreate: {
|
|
811
1009
|
method: "POST",
|
|
812
1010
|
path: "/web/factory/projects/:id/boards",
|
|
@@ -877,6 +1075,20 @@ const FACTORY_ROUTE_CONTRACTS = {
|
|
|
877
1075
|
querySchema: boardDeleteQuerySchema,
|
|
878
1076
|
responseSchema: z.null()
|
|
879
1077
|
},
|
|
1078
|
+
intakeRouteReroutePreview: {
|
|
1079
|
+
method: "GET",
|
|
1080
|
+
path: "/web/factory/projects/:id/intake-routes/reroute",
|
|
1081
|
+
description: "Untouched cards the project's intake routes would now file on a different board",
|
|
1082
|
+
pathSchema: projectPathSchema,
|
|
1083
|
+
responseSchema: intakeRerouteResponseSchema
|
|
1084
|
+
},
|
|
1085
|
+
intakeRouteRerouteApply: {
|
|
1086
|
+
method: "POST",
|
|
1087
|
+
path: "/web/factory/projects/:id/intake-routes/reroute",
|
|
1088
|
+
description: "Move untouched cards to the start of the board the project's intake routes now file them on",
|
|
1089
|
+
pathSchema: projectPathSchema,
|
|
1090
|
+
responseSchema: intakeRerouteApplyResponseSchema
|
|
1091
|
+
},
|
|
880
1092
|
intakeRouteReorder: {
|
|
881
1093
|
method: "POST",
|
|
882
1094
|
path: "/web/factory/projects/:id/intake-routes/reorder",
|
|
@@ -890,12 +1102,44 @@ const FACTORY_ROUTE_CONTRACTS = {
|
|
|
890
1102
|
path: "/web/factory/projects/:id/work-items",
|
|
891
1103
|
description: "List Factory work items and running sessions",
|
|
892
1104
|
pathSchema: projectPathSchema,
|
|
1105
|
+
querySchema: workItemListQuerySchema,
|
|
893
1106
|
responseSchema: z.object({
|
|
1107
|
+
/** Every listed card, or with `removedIds` only the cards changed since the `since` sent. */
|
|
894
1108
|
workItems: z.array(cardSchema),
|
|
895
1109
|
runningSessionIds: z.array(z.string()),
|
|
896
|
-
parkedSessionIds: z.array(z.string())
|
|
1110
|
+
parkedSessionIds: z.array(z.string()),
|
|
1111
|
+
/** With `started=false`: how many cards matched, of which `workItems` holds the first `limit`. */
|
|
1112
|
+
total: z.number().int().nonnegative().optional(),
|
|
1113
|
+
/** Names this read of the whole board. Absent when the next read must list it whole again. */
|
|
1114
|
+
cursor: z.string().optional(),
|
|
1115
|
+
/** Cards gone since the `since` sent. Its presence marks an answer that holds only what moved. */
|
|
1116
|
+
removedIds: z.array(z.string()).optional(),
|
|
1117
|
+
/** With `removedIds`: `boardCheck` of the whole board, for a reader to check its merged copy against. */
|
|
1118
|
+
check: z.string().optional()
|
|
897
1119
|
})
|
|
898
1120
|
},
|
|
1121
|
+
workItemStarters: {
|
|
1122
|
+
method: "GET",
|
|
1123
|
+
path: "/web/factory/projects/:id/work-items/starters",
|
|
1124
|
+
description: "Count the cards behind each new-session starter on the default board",
|
|
1125
|
+
pathSchema: projectPathSchema,
|
|
1126
|
+
responseSchema: workItemStartersResponseSchema
|
|
1127
|
+
},
|
|
1128
|
+
workItemActivity: {
|
|
1129
|
+
method: "GET",
|
|
1130
|
+
path: "/web/factory/projects/:id/work-items/activity",
|
|
1131
|
+
description: "List when cards were created and completed since an instant",
|
|
1132
|
+
pathSchema: projectPathSchema,
|
|
1133
|
+
querySchema: workItemActivityQuerySchema,
|
|
1134
|
+
responseSchema: workItemActivityResponseSchema
|
|
1135
|
+
},
|
|
1136
|
+
workItemFilterOptions: {
|
|
1137
|
+
method: "GET",
|
|
1138
|
+
path: "/web/factory/projects/:id/work-items/filter-options",
|
|
1139
|
+
description: "List the labels and people the cards of a project can be filtered by",
|
|
1140
|
+
pathSchema: projectPathSchema,
|
|
1141
|
+
responseSchema: workItemFilterOptionsResponseSchema
|
|
1142
|
+
},
|
|
899
1143
|
workItemCreate: {
|
|
900
1144
|
method: "POST",
|
|
901
1145
|
path: "/web/factory/projects/:id/work-items",
|
|
@@ -1055,6 +1299,6 @@ const FACTORY_ROUTE_CONTRACTS = {
|
|
|
1055
1299
|
responseSchema: skillResponseSchema
|
|
1056
1300
|
}
|
|
1057
1301
|
};
|
|
1058
|
-
export { FACTORY_ROUTE_CONTRACTS, MAX_SANDBOX_ENV_VALUE_LENGTH, MAX_SKILL_OVERRIDE_LENGTH, RESERVED_SANDBOX_ENV_NAMES, THINKING_LEVELS, UUID_PATTERN, attentionQuerySchema, automationRunStartBodySchema, boardDeleteQuerySchema, boardResetBodySchema, createProjectBodySchema, createWorkItemBodySchema, decisionQuerySchema, environmentBuildResponseSchema, environmentBuildSchema, environmentBuildStartResponseSchema, environmentBuildTriggersSchema, environmentBuildsResponseSchema, environmentLastBuildSchema, environmentSandboxSchema, intakeRouteInputSchema, intakeRoutePatchSchema, intakeRouteReorderBodySchema, metricsQuerySchema, projectEnvironmentResponseSchema, projectListRepositorySchema, replaceBoardBodySchema, sandboxEnvAppliesToSchema, sandboxEnvNameSchema, sandboxEnvSetBodySchema, sandboxEnvUpdateBodySchema, skillOverrideBodySchema, skillOverrideSaveRequestSchema, startWorkItemBodySchema, transitionBodySchema, updateProjectBodySchema, updateProjectEnvironmentBodySchema, updateWorkItemBodySchema };
|
|
1302
|
+
export { BOARD_PHASES_SORTS, FACTORY_ROUTE_CONTRACTS, MAX_SANDBOX_ENV_VALUE_LENGTH, MAX_SKILL_OVERRIDE_LENGTH, RESERVED_SANDBOX_ENV_NAMES, THINKING_LEVELS, UUID_PATTERN, attentionQuerySchema, automationRunStartBodySchema, boardDeleteQuerySchema, boardPhasesQuerySchema, boardPhasesResponseSchema, boardResetBodySchema, createProjectBodySchema, createWorkItemBodySchema, decisionQuerySchema, environmentBuildResponseSchema, environmentBuildSchema, environmentBuildStartResponseSchema, environmentBuildTriggersSchema, environmentBuildsResponseSchema, environmentLastBuildSchema, environmentSandboxSchema, intakeRouteInputSchema, intakeRoutePatchSchema, intakeRouteReorderBodySchema, metricsQuerySchema, projectEnvironmentResponseSchema, projectListRepositorySchema, replaceBoardBodySchema, sandboxEnvAppliesToSchema, sandboxEnvNameSchema, sandboxEnvSetBodySchema, sandboxEnvUpdateBodySchema, skillOverrideBodySchema, skillOverrideSaveRequestSchema, startWorkItemBodySchema, transitionBodySchema, updateProjectBodySchema, updateProjectEnvironmentBodySchema, updateWorkItemBodySchema, workItemActivityQuerySchema, workItemActivityResponseSchema, workItemFilterOptionsResponseSchema, workItemStartersResponseSchema };
|
|
1059
1303
|
|
|
1060
1304
|
//# sourceMappingURL=contracts.js.map
|