@mastra/factory 0.29.1-alpha.0 → 0.29.1-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/dist/factory.d.ts.map +1 -1
  3. package/dist/factory.js +10 -3
  4. package/dist/factory.js.map +1 -1
  5. package/dist/routes/contracts.d.ts +8 -0
  6. package/dist/routes/contracts.d.ts.map +1 -1
  7. package/dist/routes/contracts.js +3 -1
  8. package/dist/routes/contracts.js.map +1 -1
  9. package/dist/routes/run-stop-marker.d.ts +13 -0
  10. package/dist/routes/run-stop-marker.d.ts.map +1 -0
  11. package/dist/routes/run-stop-marker.js +36 -0
  12. package/dist/routes/run-stop-marker.js.map +1 -0
  13. package/dist/routes/session-access.d.ts +1 -0
  14. package/dist/routes/session-access.d.ts.map +1 -1
  15. package/dist/routes/session-access.js +1 -1
  16. package/dist/routes/session-access.js.map +1 -1
  17. package/dist/routes/session-rows.d.ts.map +1 -1
  18. package/dist/routes/session-rows.js +1 -0
  19. package/dist/routes/session-rows.js.map +1 -1
  20. package/dist/rules/dispatcher.d.ts.map +1 -1
  21. package/dist/rules/dispatcher.js +57 -16
  22. package/dist/rules/dispatcher.js.map +1 -1
  23. package/dist/session/session-row-query.d.ts +6 -0
  24. package/dist/session/session-row-query.d.ts.map +1 -1
  25. package/dist/session/session-row-query.js +6 -2
  26. package/dist/session/session-row-query.js.map +1 -1
  27. package/dist/session/session-row-view.d.ts.map +1 -1
  28. package/dist/session/session-row-view.js +7 -2
  29. package/dist/session/session-row-view.js.map +1 -1
  30. package/dist/storage/domains/work-items/base.d.ts +19 -0
  31. package/dist/storage/domains/work-items/base.d.ts.map +1 -1
  32. package/dist/storage/domains/work-items/base.js +29 -0
  33. package/dist/storage/domains/work-items/base.js.map +1 -1
  34. package/package.json +6 -6
package/README.md CHANGED
@@ -66,7 +66,7 @@ Two reads answer questions about a project's cards without listing them. `GET /w
66
66
 
67
67
  Two more reads serve a board without sending every card. `GET /web/factory/projects/:id/boards/:boardKey/phases` returns one entry per phase of the board in `phases`, in the board's order: `phase` is its id, `total` counts the cards in it, and `cards` names the first of them as `{ id, version }`. `version` names the card's body: it is another value whenever anything in the body is, including a change that leaves `changedAt` as it was. `limit` sets how many each phase names (50 unless given, 200 at most), `window=<phase>:<count>` (repeatable) names more cards of one phase, and `item=<card id>` asks for one card wherever it lies: the answer names it in `item` as `{ id, version, places }`, where `places` gives each phase the view lists it under and its `position` there (how many cards the phase lists before it), and `cards=true` sends its body. No phase names more cards for it, so the answer is the same size for the oldest card of a phase as for the newest. `places` is empty when the search or filters leave the card out, and `item` is absent when the board does not hold the card. `sort` is `recent` (latest entry into the phase first, the default), `recent-mine` (the cards the signed-in user last moved into the phase first), `created-newest` or `created-oldest`. `q` keeps the cards whose title, key, number or source id contains every word in it; `label`, `source`, `linearProject`, `teammate`, `author`, `assignee`, `reviewer` and `worked` (all repeatable) keep the cards matching every field given. `boardTotal` counts the board's cards whatever the search and filters, `matchingTotal` the cards matching them, a card in two phases once. `related` names the cards related to a named card that no phase names, the first `limit` of each card's, and `relatedTotal` counts them all. Pass `cards=true` to also receive the body of every named card in `workItems`, each with its `version`; without it, read the cards whose `version` differs from the copy you kept with `GET /web/factory/projects/:id/work-items?workItemId=<id>`, which sends each card with its `version` too. A card in none of the board's phases is counted in the first one. A malformed parameter is a 400 `invalid_phases_query`; a board the project doesn't have is a 404; a `window` for a phase the board doesn't have is ignored. `GET /web/factory/projects/:id/work-items/filter-options` returns what a board can be filtered by, over every card of the project: `labels`, sorted; `people`, each person a source names as author, assignee or requested reviewer, as `{ id, name, source }`; and `actorIds`, the Factory users who filed, moved or started a card. Both answers carry an `ETag`; send it back as `If-None-Match` and an unchanged answer is a 304.
68
68
 
69
- Two reads serve the sidebar's sessions without sending every session and every card holding one. `GET /web/factory/projects/:id/session-rows` returns the rows of one view of the project's sessions, built on the server: one row per card for a card's sessions (`cardSessionIds` names them all; `children=true` lists the others under the row in `childRows` instead), and one row per session a person or Slack started. Each row carries its `session`, its `status` (`waiting`, `working`, `initializing`, `idle` or `done`), the card it works on, and the card's pull or merge request. `sort` is `activity` (the default), `updated` or `created`; `groupBy` is `none` (the default), `board`, `status` or `owner`; `owner` is `all`, `mine` or `owner:<user id>`; `status` and `updated` (`24h`, `7d` or `30d`) keep the matching rows. `groups` lists the groups holding a matching row, in the order their first row sorts, each with its `key`, its `total` and its first 5 `rows`; `window=<group key>:<count>` (repeatable, 500 at most) lists more of one group. `pin=<session id>` (repeatable) lists sessions before every other one of their group, and `open=<session id>` keeps that session's row listed in its group however deep it lies, with its place in `openIndex`. `total` counts every row, `matching` the rows the filters keep, and `boards` and `owners` name every board and person some row has, whatever the filters. `GET /web/factory/projects/:id/session-activity` returns which sessions are running or waiting on a person's answer, each card's status as its row in `session-rows` shows it in `cardStatuses` (only cards neither idle nor done), the cards one of whose sessions is coming up, running or parked on a person in `sessionHeldCardIds` (no other run may start on those), and how many of the cards in `cardStatuses` are working or waiting. Every write that changes either answer sends a frame on the project's feed, whichever replica made it: read again on a frame. Both carry an `ETag`; send it back as `If-None-Match` and an unchanged answer is a 304. A malformed `session-rows` parameter is a 400 `invalid_session_rows_query`.
69
+ Two reads serve the sidebar's sessions without sending every session and every card holding one. `GET /web/factory/projects/:id/session-rows` returns the rows of one view of the project's sessions, built on the server: one row per card for a card's sessions (`cardSessionIds` names them all; `children=true` lists the others under the row in `childRows` instead), and one row per session a person or Slack started. Each row carries its `session`, its `status` (`waiting`, `working`, `initializing`, `idle` or `done`), the card it works on, and the card's pull or merge request. `sort` is `activity` (the default), `updated` or `created`; `groupBy` is `none` (the default), `board`, `status` or `owner`; `owner` is `all`, `mine` or `owner:<user id>`; `status` and `updated` (`24h`, `7d` or `30d`) keep the matching rows; `source` keeps the rows that start in one place: `board:<board id>` for that board's cards, `user` for sessions a person started, `slack` for those Slack started, the same keys `groupBy=board` groups under. `groups` lists the groups holding a matching row, in the order their first row sorts, each with its `key`, its `total` and its first 5 `rows`; `window=<group key>:<count>` (repeatable, 500 at most) lists more of one group. `pin=<session id>` (repeatable) lists sessions before every other one of their group, and `open=<session id>` keeps that session's row listed in its group however deep it lies, with its place in `openIndex`. `total` counts every row, `matching` the rows the filters keep, and `boards` and `owners` name every board and person some row has, whatever the filters. `GET /web/factory/projects/:id/session-activity` returns which sessions are running or waiting on a person's answer, each card's status as its row in `session-rows` shows it in `cardStatuses` (only cards neither idle nor done), the cards one of whose sessions is coming up, running or parked on a person in `sessionHeldCardIds` (no other run may start on those), and how many of the cards in `cardStatuses` are working or waiting. Every write that changes either answer sends a frame on the project's feed, whichever replica made it: read again on a frame. Both carry an `ETag`; send it back as `If-None-Match` and an unchanged answer is a 304. A malformed `session-rows` parameter is a 400 `invalid_session_rows_query`.
70
70
 
71
71
  #### Migration and dry run
72
72
 
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,sBAAsB,CAAC;AAE9E,OAAO,KAAK,EA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AAE,cAAc,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAKtG;IAED;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,CA80DnC;IAED;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CA0B9B;IAiBD,oGAAoG;IAC9F,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAqD9B;CACF"}
package/dist/factory.js CHANGED
@@ -33,6 +33,7 @@ import { createCustomProvidersPrimer, primeCustomProvidersForRequestContext, reg
33
33
  import { buildFeedEventsRoutes } from "./routes/feed-events.js";
34
34
  import { ProjectRoutes } from "./routes/projects.js";
35
35
  import { tenantOrgId } from "./routes/provider-credentials.js";
36
+ import { createRunStopMarker } from "./routes/run-stop-marker.js";
36
37
  import { SandboxEnvRoutes } from "./routes/sandbox-envs.js";
37
38
  import { createSessionAccessGuard } from "./routes/session-access.js";
38
39
  import { assembleFactoryApiRoutes, buildIntegrationContext } from "./routes/surface.js";
@@ -47,19 +48,19 @@ import { createTerminalStageCleanup } from "./rules/terminal-cleanup.js";
47
48
  import { createFactoryTransitionTools } from "./rules/tools.js";
48
49
  import { FactoryTransitionService } from "./rules/transition-service.js";
49
50
  import { assertFactoryConfigVersion } from "./rules/validation.js";
50
- import { CallbackFactorySandbox } from "./sandbox/callback-factory-sandbox.js";
51
51
  import { resolveFactoryToolScope } from "./tools/scope.js";
52
+ import { CallbackFactorySandbox } from "./sandbox/callback-factory-sandbox.js";
52
53
  import { controllerRunInFlight, createContextSandboxStops, createTerminalSandboxStops } from "./sandbox/context-sandboxes.js";
53
54
  import { isValidGitRef } from "./sandbox/git-ref.js";
54
55
  import { LocalFactorySandbox } from "./sandbox/local-factory-sandbox.js";
55
56
  import { CachedSandboxEnvs } from "./sandbox/sandbox-env-cache.js";
56
57
  import { SessionRetirementCoordinator } from "./sandbox/session-retirement.js";
57
- import { peekSessionSandbox } from "./sandbox/session-sandbox.js";
58
58
  import { applyFactoryToolPermissions } from "./tools/permissions.js";
59
+ import { peekSessionSandbox } from "./sandbox/session-sandbox.js";
59
60
  import { createPlaintextFactorySecretEncryption } from "./secret-encryption.js";
60
61
  import { handleServerError } from "./server-error.js";
61
- import { resolveFactoryCredentialTenant, resolveFactoryModelPolicy } from "./session/credential-policy.js";
62
62
  import { metricsService, resolveMetricsConfig } from "./metrics/config.js";
63
+ import { resolveFactoryCredentialTenant, resolveFactoryModelPolicy } from "./session/credential-policy.js";
63
64
  import { hydrateSessionDefaultModel } from "./session/default-model-hydration.js";
64
65
  import { environmentSlugs, resolveSessionRepositories } from "./session/environment-repositories.js";
65
66
  import { FactoryEnvironmentStateProcessor } from "./session/environment-state-processor.js";
@@ -1547,10 +1548,15 @@ var MastraFactory = class {
1547
1548
  const spa = uiDist ? [createSpaStaticMiddleware(uiDist)] : [];
1548
1549
  const timing = factoryTimingEnabled ? [createRequestTimingMiddleware()] : [];
1549
1550
  const sessionActivity = createSessionActivityMiddleware(() => this.#sessionUnloader);
1551
+ const runStopMarker = createRunStopMarker({
1552
+ auth: routeAuth,
1553
+ workItems: () => storage.isDomainReady("work-items") ? workItemsStorage : void 0
1554
+ });
1550
1555
  if (!auth) return {
1551
1556
  middleware: [
1552
1557
  ...timing,
1553
1558
  sessionActivity,
1559
+ runStopMarker,
1554
1560
  createFactoryInteractiveMarker(),
1555
1561
  createCustomProvidersPrimer({
1556
1562
  auth: routeAuth,
@@ -1577,6 +1583,7 @@ var MastraFactory = class {
1577
1583
  } },
1578
1584
  controller: () => this.#prepared?.base.controller
1579
1585
  }),
1586
+ runStopMarker,
1580
1587
  sessionActivity,
1581
1588
  createTenantCredentialPrimer({
1582
1589
  auth: routeAuth,