@mastra/factory 0.25.0 → 0.26.0-alpha.1

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 (237) hide show
  1. package/README.md +158 -57
  2. package/dist/auth.d.ts.map +1 -1
  3. package/dist/boards/card-facts.d.ts +5 -0
  4. package/dist/boards/card-facts.d.ts.map +1 -0
  5. package/dist/boards/card-facts.js +19 -0
  6. package/dist/boards/card-facts.js.map +1 -0
  7. package/dist/boards/define-board.d.ts +109 -13
  8. package/dist/boards/define-board.d.ts.map +1 -1
  9. package/dist/boards/define-board.js +163 -21
  10. package/dist/boards/define-board.js.map +1 -1
  11. package/dist/boards/index.d.ts +4 -3
  12. package/dist/boards/index.d.ts.map +1 -1
  13. package/dist/boards/index.js +3 -2
  14. package/dist/boards/index.js.map +1 -1
  15. package/dist/boards/legacy-plan-role.d.ts +14 -0
  16. package/dist/boards/legacy-plan-role.d.ts.map +1 -0
  17. package/dist/boards/legacy-plan-role.js +32 -0
  18. package/dist/boards/legacy-plan-role.js.map +1 -0
  19. package/dist/boards/phase-automation.d.ts +13 -0
  20. package/dist/boards/phase-automation.d.ts.map +1 -0
  21. package/dist/boards/phase-automation.js +25 -0
  22. package/dist/boards/phase-automation.js.map +1 -0
  23. package/dist/boards/phase-runner.d.ts +13 -0
  24. package/dist/boards/phase-runner.d.ts.map +1 -0
  25. package/dist/boards/phase-runner.js +44 -0
  26. package/dist/boards/phase-runner.js.map +1 -0
  27. package/dist/boards/relocate.d.ts.map +1 -1
  28. package/dist/boards/relocate.js +2 -0
  29. package/dist/boards/relocate.js.map +1 -1
  30. package/dist/boards/review.d.ts +1 -1
  31. package/dist/boards/review.d.ts.map +1 -1
  32. package/dist/boards/review.js +18 -18
  33. package/dist/boards/review.js.map +1 -1
  34. package/dist/boards/semantics.d.ts.map +1 -1
  35. package/dist/boards/semantics.js +11 -7
  36. package/dist/boards/semantics.js.map +1 -1
  37. package/dist/boards/transition-policy.d.ts +10 -10
  38. package/dist/boards/work-tool-rules.d.ts +3 -3
  39. package/dist/boards/work-tool-rules.d.ts.map +1 -1
  40. package/dist/boards/work-tool-rules.js +1 -1
  41. package/dist/boards/work-tool-rules.js.map +1 -1
  42. package/dist/boards/work.d.ts +3 -3
  43. package/dist/boards/work.d.ts.map +1 -1
  44. package/dist/boards/work.js +31 -29
  45. package/dist/boards/work.js.map +1 -1
  46. package/dist/environment/build-runner.d.ts +4 -4
  47. package/dist/environment/build-runner.d.ts.map +1 -1
  48. package/dist/environment/build-workflow.d.ts +6 -6
  49. package/dist/environment/build-workflow.js +1 -1
  50. package/dist/environment/build.d.ts +1 -1
  51. package/dist/environment/build.d.ts.map +1 -1
  52. package/dist/factory.d.ts +8 -0
  53. package/dist/factory.d.ts.map +1 -1
  54. package/dist/factory.js +6 -0
  55. package/dist/factory.js.map +1 -1
  56. package/dist/index.d.ts +3 -2
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +2 -2
  59. package/dist/integrations/github/app-identity.d.ts.map +1 -1
  60. package/dist/integrations/github/default-rules.d.ts +71 -71
  61. package/dist/integrations/github/default-rules.d.ts.map +1 -1
  62. package/dist/integrations/github/integration.d.ts.map +1 -1
  63. package/dist/integrations/github/reconcile-worker.d.ts.map +1 -1
  64. package/dist/integrations/github/rules.d.ts.map +1 -1
  65. package/dist/integrations/github/sandbox.d.ts.map +1 -1
  66. package/dist/integrations/gitlab/api.d.ts.map +1 -1
  67. package/dist/integrations/gitlab/default-rules.d.ts +38 -38
  68. package/dist/integrations/gitlab/default-rules.d.ts.map +1 -1
  69. package/dist/integrations/gitlab/integration.d.ts.map +1 -1
  70. package/dist/integrations/gitlab/rules.d.ts.map +1 -1
  71. package/dist/integrations/incidentio/api.d.ts.map +1 -1
  72. package/dist/integrations/incidentio/default-rules.d.ts +3 -3
  73. package/dist/integrations/incidentio/default-rules.d.ts.map +1 -1
  74. package/dist/integrations/incidentio/integration.d.ts.map +1 -1
  75. package/dist/integrations/incidentio/rules.d.ts.map +1 -1
  76. package/dist/integrations/issue-reconcile-worker.d.ts.map +1 -1
  77. package/dist/integrations/jira/api.d.ts +1 -1
  78. package/dist/integrations/jira/api.d.ts.map +1 -1
  79. package/dist/integrations/jira/default-rules.d.ts +3 -3
  80. package/dist/integrations/jira/default-rules.d.ts.map +1 -1
  81. package/dist/integrations/jira/integration.d.ts.map +1 -1
  82. package/dist/integrations/jira/rules.d.ts.map +1 -1
  83. package/dist/integrations/linear/default-rules.d.ts +8 -8
  84. package/dist/integrations/linear/default-rules.d.ts.map +1 -1
  85. package/dist/integrations/linear/integration.d.ts.map +1 -1
  86. package/dist/integrations/linear/rules.d.ts.map +1 -1
  87. package/dist/integrations/platform/api-client.d.ts.map +1 -1
  88. package/dist/integrations/platform/github/event-worker.d.ts.map +1 -1
  89. package/dist/integrations/platform/github/integration.d.ts.map +1 -1
  90. package/dist/integrations/platform/gitlab/event-worker.d.ts.map +1 -1
  91. package/dist/integrations/platform/gitlab/integration.d.ts.map +1 -1
  92. package/dist/integrations/platform/incidentio/integration.d.ts.map +1 -1
  93. package/dist/integrations/platform/jira/integration.d.ts.map +1 -1
  94. package/dist/integrations/platform/linear/event-worker.d.ts.map +1 -1
  95. package/dist/integrations/platform/linear/integration.d.ts.map +1 -1
  96. package/dist/integrations/slack/channel-reply-processor.d.ts.map +1 -1
  97. package/dist/integrations/slack/channel-session-link-processor.d.ts.map +1 -1
  98. package/dist/integrations/slack/feed-publisher.d.ts.map +1 -1
  99. package/dist/integrations/slack/integration.d.ts.map +1 -1
  100. package/dist/integrations/slack/reply-reminder-processor.d.ts.map +1 -1
  101. package/dist/integrations/slack/reply-tool.d.ts.map +1 -1
  102. package/dist/integrations/slack/run-error-card.d.ts.map +1 -1
  103. package/dist/integrations/slack/run-error-card.js +25 -8
  104. package/dist/integrations/slack/run-error-card.js.map +1 -1
  105. package/dist/integrations/slack/slack.d.ts.map +1 -1
  106. package/dist/integrations/workos/integration.d.ts.map +1 -1
  107. package/dist/mcp/events.d.ts +3 -3
  108. package/dist/mcp/routes.js +1 -1
  109. package/dist/routes/attention-activity.d.ts +1 -1
  110. package/dist/routes/attention-activity.d.ts.map +1 -1
  111. package/dist/routes/attention-parked.d.ts +1 -1
  112. package/dist/routes/attention-parked.d.ts.map +1 -1
  113. package/dist/routes/attention-providers.d.ts +1 -1
  114. package/dist/routes/attention-providers.d.ts.map +1 -1
  115. package/dist/routes/automation-runs.d.ts.map +1 -1
  116. package/dist/routes/config.d.ts +4 -1
  117. package/dist/routes/config.d.ts.map +1 -1
  118. package/dist/routes/config.js +22 -2
  119. package/dist/routes/config.js.map +1 -1
  120. package/dist/routes/contracts.d.ts +159 -136
  121. package/dist/routes/contracts.d.ts.map +1 -1
  122. package/dist/routes/contracts.js +23 -0
  123. package/dist/routes/contracts.js.map +1 -1
  124. package/dist/routes/fs.d.ts.map +1 -1
  125. package/dist/routes/fs.js +24 -0
  126. package/dist/routes/fs.js.map +1 -1
  127. package/dist/routes/intake.d.ts.map +1 -1
  128. package/dist/routes/knowledge.d.ts.map +1 -1
  129. package/dist/routes/oauth.d.ts.map +1 -1
  130. package/dist/routes/projects.d.ts.map +1 -1
  131. package/dist/routes/route.d.ts.map +1 -1
  132. package/dist/routes/skills.d.ts +3 -0
  133. package/dist/routes/skills.d.ts.map +1 -1
  134. package/dist/routes/skills.js +1 -1
  135. package/dist/routes/skills.js.map +1 -1
  136. package/dist/routes/surface.d.ts +3 -0
  137. package/dist/routes/surface.d.ts.map +1 -1
  138. package/dist/routes/surface.js +23 -22
  139. package/dist/routes/surface.js.map +1 -1
  140. package/dist/routes/telemetry.d.ts.map +1 -1
  141. package/dist/routes/tenant-credentials.d.ts.map +1 -1
  142. package/dist/routes/work-items.d.ts.map +1 -1
  143. package/dist/routes/work-items.js +19 -3
  144. package/dist/routes/work-items.js.map +1 -1
  145. package/dist/rules/decision-applicability.d.ts.map +1 -1
  146. package/dist/rules/decision-applicability.js +3 -1
  147. package/dist/rules/decision-applicability.js.map +1 -1
  148. package/dist/rules/dispatch-errors.d.ts.map +1 -1
  149. package/dist/rules/dispatcher.d.ts.map +1 -1
  150. package/dist/rules/dispatcher.js +17 -3
  151. package/dist/rules/dispatcher.js.map +1 -1
  152. package/dist/rules/processor.d.ts.map +1 -1
  153. package/dist/rules/processor.js +4 -2
  154. package/dist/rules/processor.js.map +1 -1
  155. package/dist/rules/rule-group.d.ts +29 -0
  156. package/dist/rules/rule-group.d.ts.map +1 -0
  157. package/dist/rules/rule-group.js +141 -0
  158. package/dist/rules/rule-group.js.map +1 -0
  159. package/dist/rules/start-coordinator.d.ts.map +1 -1
  160. package/dist/rules/terminal-cleanup.d.ts.map +1 -1
  161. package/dist/rules/tools.d.ts +1 -1
  162. package/dist/rules/tools.d.ts.map +1 -1
  163. package/dist/rules/transition-service.d.ts.map +1 -1
  164. package/dist/rules/transition-service.js +5 -3
  165. package/dist/rules/transition-service.js.map +1 -1
  166. package/dist/rules/types.d.ts +25 -14
  167. package/dist/rules/types.d.ts.map +1 -1
  168. package/dist/rules/types.js.map +1 -1
  169. package/dist/rules/validation.d.ts +2 -0
  170. package/dist/rules/validation.d.ts.map +1 -1
  171. package/dist/rules/validation.js +6 -3
  172. package/dist/rules/validation.js.map +1 -1
  173. package/dist/run-error.d.ts +1 -1
  174. package/dist/run-error.d.ts.map +1 -1
  175. package/dist/run-error.js +16 -11
  176. package/dist/run-error.js.map +1 -1
  177. package/dist/sandbox/callback-factory-sandbox.d.ts.map +1 -1
  178. package/dist/sandbox/local-factory-sandbox.d.ts.map +1 -1
  179. package/dist/sandbox/session-retirement.d.ts.map +1 -1
  180. package/dist/session/environment-state-processor.d.ts.map +1 -1
  181. package/dist/session/factory-session.d.ts.map +1 -1
  182. package/dist/session/live-sessions.d.ts.map +1 -1
  183. package/dist/session/reply-credential-processor.d.ts +8 -0
  184. package/dist/session/reply-credential-processor.d.ts.map +1 -1
  185. package/dist/session/reply-credential-processor.js +20 -11
  186. package/dist/session/reply-credential-processor.js.map +1 -1
  187. package/dist/session/run-audit.d.ts +1 -1
  188. package/dist/session/run-audit.d.ts.map +1 -1
  189. package/dist/skills/app-skills.d.ts +11 -0
  190. package/dist/skills/app-skills.d.ts.map +1 -0
  191. package/dist/skills/app-skills.js +37 -0
  192. package/dist/skills/app-skills.js.map +1 -0
  193. package/dist/skills/catalog.d.ts +9 -3
  194. package/dist/skills/catalog.d.ts.map +1 -1
  195. package/dist/skills/catalog.js +35 -19
  196. package/dist/skills/catalog.js.map +1 -1
  197. package/dist/skills/service.d.ts.map +1 -1
  198. package/dist/spa-static.d.ts.map +1 -1
  199. package/dist/storage/domains/audit/actions.d.ts +6 -6
  200. package/dist/storage/domains/audit/actions.d.ts.map +1 -1
  201. package/dist/storage/domains/audit/actors.d.ts +1 -1
  202. package/dist/storage/domains/audit/actors.d.ts.map +1 -1
  203. package/dist/storage/domains/audit/base.d.ts.map +1 -1
  204. package/dist/storage/domains/audit/domain.d.ts.map +1 -1
  205. package/dist/storage/domains/channel-identity/base.d.ts.map +1 -1
  206. package/dist/storage/domains/comments/base.d.ts.map +1 -1
  207. package/dist/storage/domains/comments/domain.d.ts.map +1 -1
  208. package/dist/storage/domains/comments/feed-context.d.ts.map +1 -1
  209. package/dist/storage/domains/credentials/base.d.ts.map +1 -1
  210. package/dist/storage/domains/custom-providers/base.d.ts.map +1 -1
  211. package/dist/storage/domains/filesystem/base.d.ts.map +1 -1
  212. package/dist/storage/domains/intake/base.d.ts.map +1 -1
  213. package/dist/storage/domains/integrations/base.d.ts.map +1 -1
  214. package/dist/storage/domains/memory-settings/base.d.ts.map +1 -1
  215. package/dist/storage/domains/model-defaults/base.d.ts.map +1 -1
  216. package/dist/storage/domains/projects/base.d.ts +1 -1
  217. package/dist/storage/domains/projects/base.d.ts.map +1 -1
  218. package/dist/storage/domains/queue-health/base.d.ts.map +1 -1
  219. package/dist/storage/domains/source-control/base.d.ts.map +1 -1
  220. package/dist/storage/domains/source-control/inmemory.d.ts +5 -5
  221. package/dist/storage/domains/source-control/inmemory.d.ts.map +1 -1
  222. package/dist/storage/domains/work-items/base.d.ts +1 -1
  223. package/dist/storage/domains/work-items/base.d.ts.map +1 -1
  224. package/dist/storage/domains/work-items/board-version.d.ts.map +1 -1
  225. package/dist/telemetry-types.d.ts +1 -1
  226. package/dist/telemetry-types.d.ts.map +1 -1
  227. package/dist/timing.d.ts.map +1 -1
  228. package/dist/tools/session-tools.d.ts.map +1 -1
  229. package/dist/tools/session-tools.js +3 -1
  230. package/dist/tools/session-tools.js.map +1 -1
  231. package/dist/tools/sessions-state-processor.d.ts.map +1 -1
  232. package/dist/tools/work-item-tools.js +1 -1
  233. package/dist/workspace.d.ts +13 -6
  234. package/dist/workspace.d.ts.map +1 -1
  235. package/dist/workspace.js +66 -14
  236. package/dist/workspace.js.map +1 -1
  237. package/package.json +8 -8
package/dist/workspace.js CHANGED
@@ -10,12 +10,13 @@ import { repositoryDirectoryName } from "./sandbox/workdir.js";
10
10
  import { createEnvironmentSetupHook, createSessionSetupHook, evictSessionSandbox, getSessionSandbox, hasFailedSetupCommand, recordFailedSetupCommand, resolveSessionWorkdir } from "./sandbox/session-sandbox.js";
11
11
  import { clearSessionEnvironment, recordSessionEnvironment, setSessionEnvironmentNote } from "./session/environment-state-processor.js";
12
12
  import { LocalSkillSource, Workspace } from "@mastra/core/workspace";
13
+ import { DEFAULT_CONFIG_DIR } from "@mastra/code-sdk/constants";
13
14
  import { existsSync } from "fs";
14
15
  import path, { dirname, join } from "path";
15
16
  import { fileURLToPath } from "url";
16
17
  import { SandboxFilesystem } from "@mastra/code-sdk/agents/sandbox-filesystem";
17
18
  import { MASTRACODE_WORKSPACE_TOOLS } from "@mastra/code-sdk/agents/tool-availability";
18
- import { DEFAULT_CONFIG_DIR } from "@mastra/code-sdk/constants";
19
+ import { InlineSkillSource } from "@mastra/core/skills";
19
20
  // src/workspace.ts
20
21
  const WORKSPACE_ID_PREFIX = "mfw";
21
22
  const bundleDirectory = dirname(fileURLToPath(import.meta.url));
@@ -24,14 +25,17 @@ const BUNDLED_FACTORY_SKILLS_PATH = [bundledFactorySkillsPath, join(bundleDirect
24
25
  /**
25
26
  * Resolve the consumer repo's local Factory skills root, if any. Checked in
26
27
  * addition to the bundled skills so projects can add (or override) Factory
27
- * skills without patching the installed package. Candidates cover the cwd
28
- * variants the dev server runs with (`repo root`, `--dir src/mastra` which
29
- * runs with cwd `src/mastra/public`), then the platform build output when
30
- * the server runs from its parent directory.
28
+ * skills without patching the installed package. Skills live in
29
+ * `src/mastra/factory-skills`; `src/mastra/public/factory-skills` is the older
30
+ * location and still works. Candidates cover the cwd variants the dev server
31
+ * runs with (`repo root`, `mastra dev` which runs with cwd `src/mastra/public`),
32
+ * then the platform build output when the server runs from its parent directory.
31
33
  */
32
34
  function resolveLocalFactorySkillsPath(cwd = process.cwd()) {
33
35
  return [
36
+ join(cwd, "src", "mastra", "factory-skills"),
34
37
  join(cwd, "src", "mastra", "public", "factory-skills"),
38
+ ...path.basename(cwd) === "public" ? [join(cwd, "..", "factory-skills")] : [],
35
39
  join(cwd, "public", "factory-skills"),
36
40
  join(cwd, "factory-skills"),
37
41
  join(cwd, "output", "factory-skills")
@@ -76,18 +80,57 @@ async function rescanFactorySkills(skills) {
76
80
  rescannedOutsideResolver.set(skills, pending.catch(() => {}));
77
81
  await pending;
78
82
  }
83
+ /**
84
+ * Serves `createSkill()` skills under mount-relative paths (`<name>/SKILL.md`),
85
+ * the layout the other Factory skill layers use.
86
+ */
87
+ var CodeSkillSource = class {
88
+ #inline;
89
+ #names;
90
+ constructor(skills) {
91
+ this.#inline = new InlineSkillSource([...skills]);
92
+ this.#names = skills.map((skill) => skill.name);
93
+ }
94
+ #inlinePath(relativePath) {
95
+ return `inline/${relativePath.split(path.sep).join("/")}`;
96
+ }
97
+ async exists(relativePath) {
98
+ if (relativePath === "") return this.#names.length > 0;
99
+ return this.#inline.exists(this.#inlinePath(relativePath));
100
+ }
101
+ stat(relativePath) {
102
+ return this.#inline.stat(this.#inlinePath(relativePath));
103
+ }
104
+ readFile(relativePath) {
105
+ return this.#inline.readFile(this.#inlinePath(relativePath));
106
+ }
107
+ async readdir(relativePath) {
108
+ if (relativePath === "") return this.#names.map((name) => ({
109
+ name,
110
+ type: "directory"
111
+ }));
112
+ return this.#inline.readdir(this.#inlinePath(relativePath));
113
+ }
114
+ };
79
115
  var FactorySkillSource = class {
80
116
  fallback;
81
117
  isReviewSession;
82
118
  #bundledSource = new LocalSkillSource({ basePath: BUNDLED_FACTORY_SKILLS_PATH });
83
119
  #localSource;
120
+ #codeSource;
84
121
  #fallbackSkillRoots;
85
- constructor(fallback, fallbackSkillRoots, localSkillsPath = resolveLocalFactorySkillsPath(), isReviewSession = () => Promise.resolve(true)) {
122
+ constructor(fallback, fallbackSkillRoots, localSkillsPath = resolveLocalFactorySkillsPath(), isReviewSession = () => Promise.resolve(true), codeSkills = []) {
86
123
  this.fallback = fallback;
87
124
  this.isReviewSession = isReviewSession;
88
125
  this.#localSource = localSkillsPath ? new LocalSkillSource({ basePath: localSkillsPath }) : void 0;
126
+ this.#codeSource = codeSkills.length > 0 ? new CodeSkillSource(codeSkills) : void 0;
89
127
  this.#fallbackSkillRoots = new Set(fallbackSkillRoots.map((skillPath) => path.normalize(skillPath)));
90
128
  }
129
+ /** A code skill owns its whole directory, so a same-named folder skill never mixes in files. */
130
+ async #ownedByCode(relativePath) {
131
+ const skillName = relativePath.split(path.sep)[0];
132
+ return !!skillName && !!this.#codeSource && await this.#codeSource.exists(skillName);
133
+ }
91
134
  #isFactoryPath(skillPath) {
92
135
  const normalized = path.normalize(skillPath);
93
136
  return normalized === FACTORY_SKILLS_MOUNT || normalized.startsWith(`${FACTORY_SKILLS_MOUNT}${path.sep}`);
@@ -101,8 +144,9 @@ var FactorySkillSource = class {
101
144
  if (!skillName || !REVIEW_ONLY_FACTORY_SKILLS.has(skillName)) return false;
102
145
  return !await this.isReviewSession();
103
146
  }
104
- /** Pick the layer serving this mount-relative path: local wins when it has the entry. */
147
+ /** Pick the layer serving this mount-relative path: code skills, then local entries, then bundled. */
105
148
  async #layerFor(relativePath) {
149
+ if (await this.#ownedByCode(relativePath)) return this.#codeSource;
106
150
  if (this.#localSource && await this.#localSource.exists(relativePath)) return this.#localSource;
107
151
  return this.#bundledSource;
108
152
  }
@@ -110,6 +154,7 @@ var FactorySkillSource = class {
110
154
  if (!this.#isFactoryPath(skillPath)) return this.fallback.exists(skillPath);
111
155
  const relative = this.#factoryPath(skillPath);
112
156
  if (await this.#isHiddenReviewPath(relative)) return false;
157
+ if (await this.#ownedByCode(relative)) return this.#codeSource.exists(relative);
113
158
  if (this.#localSource && await this.#localSource.exists(relative)) return true;
114
159
  return this.#bundledSource.exists(relative);
115
160
  }
@@ -129,12 +174,18 @@ var FactorySkillSource = class {
129
174
  if (this.#isFactoryPath(skillPath)) {
130
175
  const relative = this.#factoryPath(skillPath);
131
176
  if (await this.#isHiddenReviewPath(relative)) throw skillSourceEnoent(skillPath);
177
+ if (relative !== "" && await this.#ownedByCode(relative)) return this.#codeSource.readdir(relative);
132
178
  const [bundledExists, localExists] = await Promise.all([this.#bundledSource.exists(relative), this.#localSource?.exists(relative) ?? Promise.resolve(false)]);
133
- if (!bundledExists && !localExists) throw skillSourceEnoent(skillPath);
134
- const [bundledEntries, localEntries] = await Promise.all([bundledExists ? this.#bundledSource.readdir(relative) : [], localExists ? this.#localSource.readdir(relative) : []]);
179
+ if (!bundledExists && !localExists && !(relative === "" && this.#codeSource)) throw skillSourceEnoent(skillPath);
180
+ const [bundledEntries, localEntries, codeEntries] = await Promise.all([
181
+ bundledExists ? this.#bundledSource.readdir(relative) : [],
182
+ localExists ? this.#localSource.readdir(relative) : [],
183
+ relative === "" && this.#codeSource ? this.#codeSource.readdir("") : []
184
+ ]);
135
185
  const merged = /* @__PURE__ */ new Map();
136
186
  for (const entry of bundledEntries) merged.set(entry.name, entry);
137
187
  for (const entry of localEntries) merged.set(entry.name, entry);
188
+ for (const entry of codeEntries) merged.set(entry.name, entry);
138
189
  const entries = [...merged.values()];
139
190
  if (relative !== "" || await this.isReviewSession()) return entries;
140
191
  return entries.filter((entry) => !REVIEW_ONLY_FACTORY_SKILLS.has(entry.name));
@@ -147,12 +198,13 @@ var FactorySkillSource = class {
147
198
  return entries;
148
199
  }
149
200
  /**
150
- * Names the Factory mount serves: bundled skills plus the app's local skills.
201
+ * Names the Factory mount serves: bundled skills plus the app's code and local skills.
151
202
  * Repository skills with these names are hidden so they cannot collide with
152
203
  * Factory's copy. Recomputed per scan so skill refreshes pick up local changes.
153
204
  */
154
205
  async #reservedNames() {
155
206
  const reserved = new Set(FACTORY_SKILL_NAMES);
207
+ for (const entry of await this.#codeSource?.readdir("") ?? []) reserved.add(entry.name);
156
208
  if (!this.#localSource) return reserved;
157
209
  try {
158
210
  for (const entry of await this.#localSource.readdir("")) if (entry.type === "directory") reserved.add(entry.name);
@@ -206,11 +258,11 @@ var UnmaterializedAwareSkillSource = class {
206
258
  return this.fallback.realpath ? this.fallback.realpath(skillPath) : Promise.resolve(skillPath);
207
259
  }
208
260
  };
209
- function createFactorySkillExtension(isReviewSession) {
261
+ function createFactorySkillExtension(isReviewSession, codeSkills) {
210
262
  return {
211
263
  id: "web-factory",
212
264
  paths: [FACTORY_SKILLS_MOUNT],
213
- createSource: (fallback, fallbackSkillRoots) => new FactorySkillSource(fallback, fallbackSkillRoots, resolveLocalFactorySkillsPath(), isReviewSession)
265
+ createSource: (fallback, fallbackSkillRoots) => new FactorySkillSource(fallback, fallbackSkillRoots, resolveLocalFactorySkillsPath(), isReviewSession, codeSkills)
214
266
  };
215
267
  }
216
268
  function isActiveReviewBinding(runBinding, orgId) {
@@ -558,7 +610,7 @@ function createWorkspaceFactory(options = {}) {
558
610
  return false;
559
611
  }
560
612
  };
561
- const effectiveSkillExtension = skillExtension ?? createFactorySkillExtension(() => (skillReviewChecks.get(workspaceId) ?? isReviewSession)());
613
+ const effectiveSkillExtension = skillExtension ?? createFactorySkillExtension(() => (skillReviewChecks.get(workspaceId) ?? isReviewSession)(), options.skills ?? []);
562
614
  const extensionId = effectiveSkillExtension ? `-${effectiveSkillExtension.id}` : "";
563
615
  const workspaceId = `${WORKSPACE_ID_PREFIX}-${projectRepository.id}-${session.id}${extensionId}`;
564
616
  const workspaceGeneration = workspaceRegistry.generation(session.sessionId);
@@ -1007,6 +1059,6 @@ function createWorkspaceFactory(options = {}) {
1007
1059
  };
1008
1060
  return (context) => timed("workspace.resolve", () => resolve(context));
1009
1061
  }
1010
- export { BUNDLED_FACTORY_SKILLS_PATH, FACTORY_SKILL_NAMES, FactorySkillSource, FactoryWorkspaceRegistry, REVIEW_ONLY_FACTORY_SKILLS, createWorkspaceFactory, environmentSandboxContext, rescanFactorySkills, resolveLocalFactorySkillsPath, resolveProjectEnvironment };
1062
+ export { BUNDLED_FACTORY_SKILLS_PATH, FACTORY_SKILLS_MOUNT, FACTORY_SKILL_NAMES, FactorySkillSource, FactoryWorkspaceRegistry, REVIEW_ONLY_FACTORY_SKILLS, createWorkspaceFactory, environmentSandboxContext, rescanFactorySkills, resolveLocalFactorySkillsPath, resolveProjectEnvironment };
1011
1063
 
1012
1064
  //# sourceMappingURL=workspace.js.map