@agentxm/workspace-state 0.28.4-bootstrap.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.
Files changed (215) hide show
  1. package/LICENSE +110 -0
  2. package/README.md +11 -0
  3. package/dist/src/index.d.ts +72 -0
  4. package/dist/src/index.js +88 -0
  5. package/dist/src/knowledge/discovery-config.d.ts +12 -0
  6. package/dist/src/knowledge/discovery-config.js +9 -0
  7. package/dist/src/lockfile/accepted-registry-version.d.ts +12 -0
  8. package/dist/src/lockfile/accepted-registry-version.js +13 -0
  9. package/dist/src/lockfile/entry-fields.d.ts +189 -0
  10. package/dist/src/lockfile/entry-fields.js +89 -0
  11. package/dist/src/lockfile/errors.d.ts +48 -0
  12. package/dist/src/lockfile/errors.js +27 -0
  13. package/dist/src/lockfile/index.d.ts +18 -0
  14. package/dist/src/lockfile/index.js +16 -0
  15. package/dist/src/lockfile/lockfile.d.ts +2255 -0
  16. package/dist/src/lockfile/lockfile.js +235 -0
  17. package/dist/src/lockfile/resolved-version.d.ts +4 -0
  18. package/dist/src/lockfile/resolved-version.js +7 -0
  19. package/dist/src/lockfile/schema.d.ts +3062 -0
  20. package/dist/src/lockfile/schema.js +406 -0
  21. package/dist/src/schema/index.d.ts +3 -0
  22. package/dist/src/schema/index.js +2 -0
  23. package/dist/src/schema/read-and-validate-json-file.d.ts +20 -0
  24. package/dist/src/schema/read-and-validate-json-file.js +85 -0
  25. package/dist/src/schema/types.d.ts +26 -0
  26. package/dist/src/schema/types.js +2 -0
  27. package/dist/src/settings/errors.d.ts +22 -0
  28. package/dist/src/settings/errors.js +15 -0
  29. package/dist/src/settings/format-preserving-json.d.ts +40 -0
  30. package/dist/src/settings/format-preserving-json.js +80 -0
  31. package/dist/src/settings/index.d.ts +15 -0
  32. package/dist/src/settings/index.js +14 -0
  33. package/dist/src/settings/schema.d.ts +687 -0
  34. package/dist/src/settings/schema.js +977 -0
  35. package/dist/src/settings/settings.d.ts +38 -0
  36. package/dist/src/settings/settings.js +213 -0
  37. package/dist/src/testing.d.ts +17 -0
  38. package/dist/src/testing.js +17 -0
  39. package/dist/src/utils/atomic-write.d.ts +67 -0
  40. package/dist/src/utils/atomic-write.js +71 -0
  41. package/dist/src/utils/environment.d.ts +16 -0
  42. package/dist/src/utils/environment.js +19 -0
  43. package/dist/src/utils/path-safety.d.ts +25 -0
  44. package/dist/src/utils/path-safety.js +34 -0
  45. package/dist/src/utils/resolve-parent-symlinks.d.ts +16 -0
  46. package/dist/src/utils/resolve-parent-symlinks.js +36 -0
  47. package/dist/src/workspace/accepted-canonical-ref.d.ts +58 -0
  48. package/dist/src/workspace/accepted-canonical-ref.js +229 -0
  49. package/dist/src/workspace/artifact-change.d.ts +14 -0
  50. package/dist/src/workspace/artifact-change.js +18 -0
  51. package/dist/src/workspace/canonical-observation.d.ts +39 -0
  52. package/dist/src/workspace/canonical-observation.js +307 -0
  53. package/dist/src/workspace/configured-agent-outcome.d.ts +22 -0
  54. package/dist/src/workspace/configured-agent-outcome.js +33 -0
  55. package/dist/src/workspace/configured-agent-outcomes-provider.d.ts +50 -0
  56. package/dist/src/workspace/configured-agent-outcomes-provider.js +26 -0
  57. package/dist/src/workspace/configured-agent-outcomes.d.ts +48 -0
  58. package/dist/src/workspace/configured-agent-outcomes.js +113 -0
  59. package/dist/src/workspace/configured-entry-resolution/types.d.ts +32 -0
  60. package/dist/src/workspace/configured-entry-resolution/types.js +2 -0
  61. package/dist/src/workspace/configured-entry-resolution/workspace-ref.d.ts +32 -0
  62. package/dist/src/workspace/configured-entry-resolution/workspace-ref.js +176 -0
  63. package/dist/src/workspace/constants.d.ts +6 -0
  64. package/dist/src/workspace/constants.js +6 -0
  65. package/dist/src/workspace/create-symlink.d.ts +26 -0
  66. package/dist/src/workspace/create-symlink.js +87 -0
  67. package/dist/src/workspace/desired-pack-lock.d.ts +18 -0
  68. package/dist/src/workspace/desired-pack-lock.js +132 -0
  69. package/dist/src/workspace/desired-state-enabled.d.ts +18 -0
  70. package/dist/src/workspace/desired-state-enabled.js +16 -0
  71. package/dist/src/workspace/desired-state-graph.d.ts +114 -0
  72. package/dist/src/workspace/desired-state-graph.js +384 -0
  73. package/dist/src/workspace/desired-state-problem-text.d.ts +6 -0
  74. package/dist/src/workspace/desired-state-problem-text.js +27 -0
  75. package/dist/src/workspace/errors.d.ts +184 -0
  76. package/dist/src/workspace/errors.js +79 -0
  77. package/dist/src/workspace/extension-name.d.ts +28 -0
  78. package/dist/src/workspace/extension-name.js +66 -0
  79. package/dist/src/workspace/extension-paths.d.ts +82 -0
  80. package/dist/src/workspace/extension-paths.js +172 -0
  81. package/dist/src/workspace/footprint-recorder.d.ts +30 -0
  82. package/dist/src/workspace/footprint-recorder.js +32 -0
  83. package/dist/src/workspace/layout.d.ts +43 -0
  84. package/dist/src/workspace/layout.js +164 -0
  85. package/dist/src/workspace/lock-entry-to-ref.d.ts +40 -0
  86. package/dist/src/workspace/lock-entry-to-ref.js +433 -0
  87. package/dist/src/workspace/lock-entry-to-source-params.d.ts +26 -0
  88. package/dist/src/workspace/lock-entry-to-source-params.js +81 -0
  89. package/dist/src/workspace/locked-entries.d.ts +30 -0
  90. package/dist/src/workspace/locked-entries.js +34 -0
  91. package/dist/src/workspace/materialized-file-target.d.ts +14 -0
  92. package/dist/src/workspace/materialized-file-target.js +14 -0
  93. package/dist/src/workspace/materialized-tree.d.ts +23 -0
  94. package/dist/src/workspace/materialized-tree.js +90 -0
  95. package/dist/src/workspace/mcp-entry-semantics.d.ts +31 -0
  96. package/dist/src/workspace/mcp-entry-semantics.js +60 -0
  97. package/dist/src/workspace/observed-installed.d.ts +9 -0
  98. package/dist/src/workspace/observed-installed.js +9 -0
  99. package/dist/src/workspace/pack-manifest-content-identity.d.ts +12 -0
  100. package/dist/src/workspace/pack-manifest-content-identity.js +20 -0
  101. package/dist/src/workspace/pack-paths.d.ts +24 -0
  102. package/dist/src/workspace/pack-paths.js +16 -0
  103. package/dist/src/workspace/package-hash.d.ts +25 -0
  104. package/dist/src/workspace/package-hash.js +45 -0
  105. package/dist/src/workspace/paths.d.ts +24 -0
  106. package/dist/src/workspace/paths.js +52 -0
  107. package/dist/src/workspace/read-model/__fixtures__/builder.d.ts +199 -0
  108. package/dist/src/workspace/read-model/__fixtures__/builder.js +588 -0
  109. package/dist/src/workspace/read-model/__fixtures__/decoders.d.ts +15 -0
  110. package/dist/src/workspace/read-model/__fixtures__/decoders.js +15 -0
  111. package/dist/src/workspace/read-model/__fixtures__/occurrences.d.ts +72 -0
  112. package/dist/src/workspace/read-model/__fixtures__/occurrences.js +134 -0
  113. package/dist/src/workspace/read-model/__fixtures__/scenario-harness.d.ts +99 -0
  114. package/dist/src/workspace/read-model/__fixtures__/scenario-harness.js +142 -0
  115. package/dist/src/workspace/read-model/__fixtures__/test-layer.d.ts +60 -0
  116. package/dist/src/workspace/read-model/__fixtures__/test-layer.js +57 -0
  117. package/dist/src/workspace/read-model/agent-presence.d.ts +32 -0
  118. package/dist/src/workspace/read-model/agent-presence.js +21 -0
  119. package/dist/src/workspace/read-model/agent-root-resolver.d.ts +38 -0
  120. package/dist/src/workspace/read-model/agent-root-resolver.js +35 -0
  121. package/dist/src/workspace/read-model/agents/index.d.ts +38 -0
  122. package/dist/src/workspace/read-model/agents/index.js +45 -0
  123. package/dist/src/workspace/read-model/agents/shared.d.ts +27 -0
  124. package/dist/src/workspace/read-model/agents/shared.js +63 -0
  125. package/dist/src/workspace/read-model/agents/types.d.ts +133 -0
  126. package/dist/src/workspace/read-model/agents/types.js +51 -0
  127. package/dist/src/workspace/read-model/diagnostics.d.ts +18 -0
  128. package/dist/src/workspace/read-model/diagnostics.js +14 -0
  129. package/dist/src/workspace/read-model/discovery/index.d.ts +5 -0
  130. package/dist/src/workspace/read-model/discovery/index.js +5 -0
  131. package/dist/src/workspace/read-model/discovery/plugin-manifests.d.ts +16 -0
  132. package/dist/src/workspace/read-model/discovery/plugin-manifests.js +168 -0
  133. package/dist/src/workspace/read-model/discovery/skills.d.ts +58 -0
  134. package/dist/src/workspace/read-model/discovery/skills.js +263 -0
  135. package/dist/src/workspace/read-model/discovery/subagents.d.ts +37 -0
  136. package/dist/src/workspace/read-model/discovery/subagents.js +48 -0
  137. package/dist/src/workspace/read-model/errors.d.ts +93 -0
  138. package/dist/src/workspace/read-model/errors.js +30 -0
  139. package/dist/src/workspace/read-model/extensions/actual-helpers.d.ts +4 -0
  140. package/dist/src/workspace/read-model/extensions/actual-helpers.js +4 -0
  141. package/dist/src/workspace/read-model/extensions/hook.d.ts +104 -0
  142. package/dist/src/workspace/read-model/extensions/hook.js +119 -0
  143. package/dist/src/workspace/read-model/extensions/index.d.ts +19 -0
  144. package/dist/src/workspace/read-model/extensions/index.js +43 -0
  145. package/dist/src/workspace/read-model/extensions/indexByName.d.ts +31 -0
  146. package/dist/src/workspace/read-model/extensions/indexByName.js +30 -0
  147. package/dist/src/workspace/read-model/extensions/inventory.d.ts +99 -0
  148. package/dist/src/workspace/read-model/extensions/inventory.js +111 -0
  149. package/dist/src/workspace/read-model/extensions/knowledge.d.ts +101 -0
  150. package/dist/src/workspace/read-model/extensions/knowledge.js +121 -0
  151. package/dist/src/workspace/read-model/extensions/mcp-server.d.ts +106 -0
  152. package/dist/src/workspace/read-model/extensions/mcp-server.js +122 -0
  153. package/dist/src/workspace/read-model/extensions/pack.d.ts +104 -0
  154. package/dist/src/workspace/read-model/extensions/pack.js +123 -0
  155. package/dist/src/workspace/read-model/extensions/package-root.d.ts +39 -0
  156. package/dist/src/workspace/read-model/extensions/package-root.js +48 -0
  157. package/dist/src/workspace/read-model/extensions/projection.d.ts +137 -0
  158. package/dist/src/workspace/read-model/extensions/projection.js +180 -0
  159. package/dist/src/workspace/read-model/extensions/rule.d.ts +104 -0
  160. package/dist/src/workspace/read-model/extensions/rule.js +113 -0
  161. package/dist/src/workspace/read-model/extensions/skill.d.ts +170 -0
  162. package/dist/src/workspace/read-model/extensions/skill.js +148 -0
  163. package/dist/src/workspace/read-model/extensions/subagent.d.ts +97 -0
  164. package/dist/src/workspace/read-model/extensions/subagent.js +120 -0
  165. package/dist/src/workspace/read-model/scanners/agent-dir.d.ts +49 -0
  166. package/dist/src/workspace/read-model/scanners/agent-dir.js +180 -0
  167. package/dist/src/workspace/read-model/scanners/agent-root.d.ts +73 -0
  168. package/dist/src/workspace/read-model/scanners/agent-root.js +148 -0
  169. package/dist/src/workspace/read-model/scanners/agent-settings.d.ts +43 -0
  170. package/dist/src/workspace/read-model/scanners/agent-settings.js +54 -0
  171. package/dist/src/workspace/read-model/scanners/canonical-extensions.d.ts +48 -0
  172. package/dist/src/workspace/read-model/scanners/canonical-extensions.js +237 -0
  173. package/dist/src/workspace/read-model/scanners/fs-helpers.d.ts +63 -0
  174. package/dist/src/workspace/read-model/scanners/fs-helpers.js +106 -0
  175. package/dist/src/workspace/read-model/scanners/index.d.ts +15 -0
  176. package/dist/src/workspace/read-model/scanners/index.js +34 -0
  177. package/dist/src/workspace/read-model/scanners/mcp-config.d.ts +47 -0
  178. package/dist/src/workspace/read-model/scanners/mcp-config.js +212 -0
  179. package/dist/src/workspace/read-model/scanners/types.d.ts +170 -0
  180. package/dist/src/workspace/read-model/scanners/types.js +86 -0
  181. package/dist/src/workspace/read-model/service.d.ts +103 -0
  182. package/dist/src/workspace/read-model/service.js +391 -0
  183. package/dist/src/workspace/read-model/state.d.ts +35 -0
  184. package/dist/src/workspace/read-model/state.js +97 -0
  185. package/dist/src/workspace/read-model/types.d.ts +75 -0
  186. package/dist/src/workspace/read-model/types.js +26 -0
  187. package/dist/src/workspace/read-model-record-readers.d.ts +34 -0
  188. package/dist/src/workspace/read-model-record-readers.js +467 -0
  189. package/dist/src/workspace/read-model-record-rows.d.ts +45 -0
  190. package/dist/src/workspace/read-model-record-rows.js +33 -0
  191. package/dist/src/workspace/read-model-record-types.d.ts +45 -0
  192. package/dist/src/workspace/read-model-record-types.js +13 -0
  193. package/dist/src/workspace/remove-if-exists.d.ts +13 -0
  194. package/dist/src/workspace/remove-if-exists.js +26 -0
  195. package/dist/src/workspace/rendered-files.d.ts +53 -0
  196. package/dist/src/workspace/rendered-files.js +50 -0
  197. package/dist/src/workspace/scope-refusal.d.ts +26 -0
  198. package/dist/src/workspace/scope-refusal.js +29 -0
  199. package/dist/src/workspace/service-interface.d.ts +479 -0
  200. package/dist/src/workspace/service-interface.js +27 -0
  201. package/dist/src/workspace/service.d.ts +1665 -0
  202. package/dist/src/workspace/service.js +1263 -0
  203. package/dist/src/workspace/setup-scope-support.d.ts +27 -0
  204. package/dist/src/workspace/setup-scope-support.js +299 -0
  205. package/dist/src/workspace/skill-paths.d.ts +33 -0
  206. package/dist/src/workspace/skill-paths.js +14 -0
  207. package/dist/src/workspace/source-metadata.d.ts +7 -0
  208. package/dist/src/workspace/source-metadata.js +10 -0
  209. package/dist/src/workspace/source-to-lock-entry.d.ts +32 -0
  210. package/dist/src/workspace/source-to-lock-entry.js +68 -0
  211. package/dist/src/workspace/test-stubs.d.ts +144 -0
  212. package/dist/src/workspace/test-stubs.js +412 -0
  213. package/dist/src/workspace/transaction.d.ts +218 -0
  214. package/dist/src/workspace/transaction.js +177 -0
  215. package/package.json +57 -0
@@ -0,0 +1,27 @@
1
+ const constraintContributorText = (contributor) => contributor.source === "pack"
2
+ ? `${contributor.dependingPack ?? "unknown Pack"} range=${contributor.range} location=${contributor.location}`
3
+ : `settings range=${contributor.range} location=${contributor.location}`;
4
+ /** Sanitized terminal text for one desired-state problem. */
5
+ export const desiredStateProblemText = (problem) => {
6
+ switch (problem.type) {
7
+ case "pack-manifest-unavailable":
8
+ return `${problem.pack}: installed pack manifest is unavailable`;
9
+ case "pack-manifest-invalid":
10
+ return `${problem.pack}: installed pack manifest is invalid`;
11
+ case "pack-identity-mismatch":
12
+ return `${problem.pack}: ${problem.detail}`;
13
+ case "pack-resolution-unavailable":
14
+ return `${problem.pack}: ${problem.detail}`;
15
+ case "pack-manifest-content-mismatch":
16
+ return `${problem.pack}: accepted version=${problem.acceptedVersion} content=${problem.acceptedContentIdentity}; observed status=${problem.status}${problem.observedVersion === undefined ? "" : ` version=${problem.observedVersion} content=${problem.observedContentIdentity}`}`;
17
+ case "projection-collision":
18
+ return `${problem.extensionType} ${problem.name}: competing identities ${problem.identities.join(", ")}`;
19
+ case "constraint-conflict":
20
+ return `${problem.extensionType} ${problem.name}: incompatible constraints ${problem.contributors.map(constraintContributorText).join(", ")}; decision=blocked; reason=no-satisfying-version`;
21
+ case "workspace-owner-missing":
22
+ return `${problem.extensionType} ${problem.name}: workspace owner is missing`;
23
+ }
24
+ };
25
+ /** Stable, sanitized terminal text for a desired-state problem set. */
26
+ export const desiredStateProblemsText = (problems) => problems.map(desiredStateProblemText).join("; ");
27
+ //# sourceMappingURL=desired-state-problem-text.js.map
@@ -0,0 +1,184 @@
1
+ /**
2
+ * Typed failure families for workspace-state operations: layout validation,
3
+ * initialization gating, facade entry lookups, and managed filesystem
4
+ * primitives. Fields are domain facts; the application error boundary owns
5
+ * rendering, codes, and suggestions.
6
+ *
7
+ * @experimental This API is unstable and may change without notice.
8
+ */
9
+ declare const WorkspaceLayoutError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
10
+ readonly _tag: "WorkspaceLayoutError";
11
+ } & Readonly<A>;
12
+ /**
13
+ * Workspace layout configuration or on-disk authored roots are invalid.
14
+ * `detail` carries the exact fact sentence the validation produced.
15
+ */
16
+ export declare class WorkspaceLayoutError extends WorkspaceLayoutError_base<{
17
+ readonly detail: string;
18
+ readonly cause?: unknown;
19
+ }> {
20
+ }
21
+ declare const WorkspaceNotInitialized_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
22
+ readonly _tag: "WorkspaceNotInitialized";
23
+ } & Readonly<A>;
24
+ /** The workspace has no settings file; it must be initialized first. */
25
+ export declare class WorkspaceNotInitialized extends WorkspaceNotInitialized_base<{
26
+ readonly settingsPath: string;
27
+ }> {
28
+ }
29
+ declare const LockedSkillMissing_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
30
+ readonly _tag: "LockedSkillMissing";
31
+ } & Readonly<A>;
32
+ /** A skill directory was requested but the lockfile holds no entry for it. */
33
+ export declare class LockedSkillMissing extends LockedSkillMissing_base<{
34
+ readonly name: string;
35
+ }> {
36
+ }
37
+ declare const SettingsEntryMissing_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
38
+ readonly _tag: "SettingsEntryMissing";
39
+ } & Readonly<A>;
40
+ /** A settings entry update targeted a name that has no configured entry. */
41
+ export declare class SettingsEntryMissing extends SettingsEntryMissing_base<{
42
+ readonly entryType: "skill" | "mcp-server";
43
+ readonly name: string;
44
+ }> {
45
+ }
46
+ declare const InvalidAgentId_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
47
+ readonly _tag: "InvalidAgentId";
48
+ } & Readonly<A>;
49
+ /** The agent ID is not a configurable agent. */
50
+ export declare class InvalidAgentId extends InvalidAgentId_base<{
51
+ readonly agentId: string;
52
+ readonly cause: unknown;
53
+ }> {
54
+ }
55
+ declare const DesiredPackGraphIncomplete_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
56
+ readonly _tag: "DesiredPackGraphIncomplete";
57
+ } & Readonly<A>;
58
+ /** Pack retention cannot be decided because the desired pack graph is incomplete. */
59
+ export declare class DesiredPackGraphIncomplete extends DesiredPackGraphIncomplete_base {
60
+ }
61
+ declare const CanonicalPathRemovalError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
62
+ readonly _tag: "CanonicalPathRemovalError";
63
+ } & Readonly<A>;
64
+ /** Removing a canonical extension path failed. */
65
+ export declare class CanonicalPathRemovalError extends CanonicalPathRemovalError_base<{
66
+ readonly path: string;
67
+ readonly step: "inspect" | "remove";
68
+ readonly cause: unknown;
69
+ }> {
70
+ }
71
+ declare const SymlinkCreationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
72
+ readonly _tag: "SymlinkCreationError";
73
+ } & Readonly<A>;
74
+ /**
75
+ * Creating or replacing a managed symlink failed. `path` carries the fact
76
+ * each step's message interpolates: the parent directory for `mkdir-parent`,
77
+ * the link path otherwise (`resolve-target` interpolates nothing).
78
+ */
79
+ export declare class SymlinkCreationError extends SymlinkCreationError_base<{
80
+ readonly path: string;
81
+ readonly step: "resolve-target" | "remove-existing" | "mkdir-parent" | "symlink";
82
+ readonly cause: unknown;
83
+ }> {
84
+ }
85
+ declare const LockEntrySourceMissing_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
86
+ readonly _tag: "LockEntrySourceMissing";
87
+ } & Readonly<A>;
88
+ /** A lockfile entry references a source name that is not configured. */
89
+ export declare class LockEntrySourceMissing extends LockEntrySourceMissing_base<{
90
+ readonly entryType: string;
91
+ readonly sourceName: string;
92
+ }> {
93
+ }
94
+ declare const LockEntryUrlInvalid_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
95
+ readonly _tag: "LockEntryUrlInvalid";
96
+ } & Readonly<A>;
97
+ /** A lockfile source URL failed to parse. */
98
+ export declare class LockEntryUrlInvalid extends LockEntryUrlInvalid_base<{
99
+ readonly value: string;
100
+ }> {
101
+ }
102
+ declare const LockEntryNameInvalid_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
103
+ readonly _tag: "LockEntryNameInvalid";
104
+ } & Readonly<A>;
105
+ /** A lockfile extension name failed to decode. */
106
+ export declare class LockEntryNameInvalid extends LockEntryNameInvalid_base<{
107
+ readonly name: string;
108
+ }> {
109
+ }
110
+ declare const LockEntryEndpointConflict_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
111
+ readonly _tag: "LockEntryEndpointConflict";
112
+ } & Readonly<A>;
113
+ /**
114
+ * A lockfile entry and the source configuration disagree about a named
115
+ * source's endpoint. `sourceKind` carries the wording the entry uses:
116
+ * "Registry" for registry entries, the source type otherwise.
117
+ */
118
+ export declare class LockEntryEndpointConflict extends LockEntryEndpointConflict_base<{
119
+ readonly sourceKind: string;
120
+ readonly sourceName: string;
121
+ readonly acceptedEndpoint: string;
122
+ readonly resolvedEndpoint: string;
123
+ }> {
124
+ }
125
+ declare const LockEntrySourceTypeConflict_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
126
+ readonly _tag: "LockEntrySourceTypeConflict";
127
+ } & Readonly<A>;
128
+ /** Configuration does not resolve a lockfile entry's source name to its type. */
129
+ export declare class LockEntrySourceTypeConflict extends LockEntrySourceTypeConflict_base<{
130
+ readonly sourceKind: string;
131
+ readonly sourceName: string;
132
+ }> {
133
+ }
134
+ declare const AcceptedResolutionMissing_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
135
+ readonly _tag: "AcceptedResolutionMissing";
136
+ } & Readonly<A>;
137
+ /** The accepted lock authority holds no resolution for the requested extension. */
138
+ export declare class AcceptedResolutionMissing extends AcceptedResolutionMissing_base<{
139
+ readonly label: string;
140
+ readonly name: string;
141
+ }> {
142
+ }
143
+ declare const InlineExtensionSourceMissing_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
144
+ readonly _tag: "InlineExtensionSourceMissing";
145
+ } & Readonly<A>;
146
+ /** An inline-configured entry has no package source, so no ref can be resolved. */
147
+ export declare class InlineExtensionSourceMissing extends InlineExtensionSourceMissing_base<{
148
+ readonly name: string;
149
+ }> {
150
+ }
151
+ declare const SupersededCanonicalRemovalFailed_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
152
+ readonly _tag: "SupersededCanonicalRemovalFailed";
153
+ } & Readonly<A>;
154
+ /** Removing a superseded canonical package during transition preparation failed. */
155
+ export declare class SupersededCanonicalRemovalFailed extends SupersededCanonicalRemovalFailed_base<{
156
+ readonly path: string;
157
+ readonly cause: unknown;
158
+ }> {
159
+ }
160
+ declare const PackageContentHashFailed_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
161
+ readonly _tag: "PackageContentHashFailed";
162
+ } & Readonly<A>;
163
+ /** Hashing package content for the advisory change marker failed. */
164
+ export declare class PackageContentHashFailed extends PackageContentHashFailed_base<{
165
+ readonly packageDir: string;
166
+ readonly cause: unknown;
167
+ }> {
168
+ }
169
+ declare const WorkspaceSourceInvalid_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
170
+ readonly _tag: "WorkspaceSourceInvalid";
171
+ } & Readonly<A>;
172
+ /**
173
+ * A configured workspace source failed validation against the canonical
174
+ * workspace package. `detail` carries the fact sentence the validation
175
+ * produced; rendering and recovery guidance stay at the boundary.
176
+ */
177
+ export declare class WorkspaceSourceInvalid extends WorkspaceSourceInvalid_base<{
178
+ readonly source: string;
179
+ readonly detail: string;
180
+ readonly cause?: unknown;
181
+ }> {
182
+ }
183
+ export {};
184
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Typed failure families for workspace-state operations: layout validation,
3
+ * initialization gating, facade entry lookups, and managed filesystem
4
+ * primitives. Fields are domain facts; the application error boundary owns
5
+ * rendering, codes, and suggestions.
6
+ *
7
+ * @experimental This API is unstable and may change without notice.
8
+ */
9
+ import * as Data from "effect/Data";
10
+ /**
11
+ * Workspace layout configuration or on-disk authored roots are invalid.
12
+ * `detail` carries the exact fact sentence the validation produced.
13
+ */
14
+ export class WorkspaceLayoutError extends Data.TaggedError("WorkspaceLayoutError") {
15
+ }
16
+ /** The workspace has no settings file; it must be initialized first. */
17
+ export class WorkspaceNotInitialized extends Data.TaggedError("WorkspaceNotInitialized") {
18
+ }
19
+ /** A skill directory was requested but the lockfile holds no entry for it. */
20
+ export class LockedSkillMissing extends Data.TaggedError("LockedSkillMissing") {
21
+ }
22
+ /** A settings entry update targeted a name that has no configured entry. */
23
+ export class SettingsEntryMissing extends Data.TaggedError("SettingsEntryMissing") {
24
+ }
25
+ /** The agent ID is not a configurable agent. */
26
+ export class InvalidAgentId extends Data.TaggedError("InvalidAgentId") {
27
+ }
28
+ /** Pack retention cannot be decided because the desired pack graph is incomplete. */
29
+ export class DesiredPackGraphIncomplete extends Data.TaggedError("DesiredPackGraphIncomplete") {
30
+ }
31
+ /** Removing a canonical extension path failed. */
32
+ export class CanonicalPathRemovalError extends Data.TaggedError("CanonicalPathRemovalError") {
33
+ }
34
+ /**
35
+ * Creating or replacing a managed symlink failed. `path` carries the fact
36
+ * each step's message interpolates: the parent directory for `mkdir-parent`,
37
+ * the link path otherwise (`resolve-target` interpolates nothing).
38
+ */
39
+ export class SymlinkCreationError extends Data.TaggedError("SymlinkCreationError") {
40
+ }
41
+ /** A lockfile entry references a source name that is not configured. */
42
+ export class LockEntrySourceMissing extends Data.TaggedError("LockEntrySourceMissing") {
43
+ }
44
+ /** A lockfile source URL failed to parse. */
45
+ export class LockEntryUrlInvalid extends Data.TaggedError("LockEntryUrlInvalid") {
46
+ }
47
+ /** A lockfile extension name failed to decode. */
48
+ export class LockEntryNameInvalid extends Data.TaggedError("LockEntryNameInvalid") {
49
+ }
50
+ /**
51
+ * A lockfile entry and the source configuration disagree about a named
52
+ * source's endpoint. `sourceKind` carries the wording the entry uses:
53
+ * "Registry" for registry entries, the source type otherwise.
54
+ */
55
+ export class LockEntryEndpointConflict extends Data.TaggedError("LockEntryEndpointConflict") {
56
+ }
57
+ /** Configuration does not resolve a lockfile entry's source name to its type. */
58
+ export class LockEntrySourceTypeConflict extends Data.TaggedError("LockEntrySourceTypeConflict") {
59
+ }
60
+ /** The accepted lock authority holds no resolution for the requested extension. */
61
+ export class AcceptedResolutionMissing extends Data.TaggedError("AcceptedResolutionMissing") {
62
+ }
63
+ /** An inline-configured entry has no package source, so no ref can be resolved. */
64
+ export class InlineExtensionSourceMissing extends Data.TaggedError("InlineExtensionSourceMissing") {
65
+ }
66
+ /** Removing a superseded canonical package during transition preparation failed. */
67
+ export class SupersededCanonicalRemovalFailed extends Data.TaggedError("SupersededCanonicalRemovalFailed") {
68
+ }
69
+ /** Hashing package content for the advisory change marker failed. */
70
+ export class PackageContentHashFailed extends Data.TaggedError("PackageContentHashFailed") {
71
+ }
72
+ /**
73
+ * A configured workspace source failed validation against the canonical
74
+ * workspace package. `detail` carries the fact sentence the validation
75
+ * produced; rendering and recovery guidance stay at the boundary.
76
+ */
77
+ export class WorkspaceSourceInvalid extends Data.TaggedError("WorkspaceSourceInvalid") {
78
+ }
79
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Pure extension-name vocabulary.
3
+ *
4
+ * Deterministic naming helpers shared by every extension type: sanitizing an
5
+ * extension name into a safe on-disk directory name and normalizing a
6
+ * human-authored label into a valid AXM extension name.
7
+ *
8
+ * @experimental This API is unstable and may change without notice.
9
+ * @packageDocumentation
10
+ */
11
+ import { type ExtensionName } from "@agentxm/extension-model/unstable/extensions/common";
12
+ /**
13
+ * Sanitizes an extension name into a safe on-disk directory name.
14
+ *
15
+ * Transformation pipeline:
16
+ * 1. Convert to lowercase
17
+ * 2. Replace non-alphanumeric characters (except `.` and `_`) with hyphens
18
+ * 3. Strip leading dots and hyphens
19
+ * 4. Truncate to 255 characters, then strip trailing dots and hyphens
20
+ * 5. Fall back to `"unnamed-skill"` if empty
21
+ * 6. Preserve canonical names; otherwise append a deterministic discriminator
22
+ */
23
+ export declare const sanitizeName: (name: string) => string;
24
+ /**
25
+ * Converts a human-authored label into a valid AXM extension name.
26
+ */
27
+ export declare const normalizeExtensionName: (name: string) => ExtensionName;
28
+ //# sourceMappingURL=extension-name.d.ts.map
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Pure extension-name vocabulary.
3
+ *
4
+ * Deterministic naming helpers shared by every extension type: sanitizing an
5
+ * extension name into a safe on-disk directory name and normalizing a
6
+ * human-authored label into a valid AXM extension name.
7
+ *
8
+ * @experimental This API is unstable and may change without notice.
9
+ * @packageDocumentation
10
+ */
11
+ import { decodeExtensionNameSync, } from "@agentxm/extension-model/unstable/extensions/common";
12
+ /**
13
+ * Sanitizes an extension name into a safe on-disk directory name.
14
+ *
15
+ * Transformation pipeline:
16
+ * 1. Convert to lowercase
17
+ * 2. Replace non-alphanumeric characters (except `.` and `_`) with hyphens
18
+ * 3. Strip leading dots and hyphens
19
+ * 4. Truncate to 255 characters, then strip trailing dots and hyphens
20
+ * 5. Fall back to `"unnamed-skill"` if empty
21
+ * 6. Preserve canonical names; otherwise append a deterministic discriminator
22
+ */
23
+ export const sanitizeName = (name) => {
24
+ const sanitized = name
25
+ .toLowerCase()
26
+ .replace(/[^a-z0-9._]+/g, "-")
27
+ .replace(/^[.-]+/, "")
28
+ .slice(0, 255)
29
+ .replace(/[.-]+$/, "");
30
+ const fallback = sanitized || "unnamed-skill";
31
+ if (fallback === name) {
32
+ return fallback;
33
+ }
34
+ // Extension names are normally canonical before reaching filesystem code.
35
+ // Preserve those stable paths. For defensive non-canonical input,
36
+ // append a deterministic discriminator so distinct display names that
37
+ // normalize to the same slug cannot address each other's files.
38
+ let high = 0x9e3779b9;
39
+ let low = 0x811c9dc5;
40
+ for (const codePoint of name) {
41
+ const value = codePoint.codePointAt(0) ?? 0;
42
+ low = Math.imul(low ^ value, 0x01000193);
43
+ high = Math.imul(high ^ value, 0x85ebca6b);
44
+ }
45
+ const discriminator = `${(high >>> 0).toString(16).padStart(8, "0")}${(low >>> 0)
46
+ .toString(16)
47
+ .padStart(8, "0")}`;
48
+ const maxSlugLength = 255 - discriminator.length - 2;
49
+ const slug = fallback.slice(0, maxSlugLength).replace(/[.-]+$/, "") || "unnamed-skill";
50
+ return `${slug}__${discriminator}`;
51
+ };
52
+ /**
53
+ * Converts a human-authored label into a valid AXM extension name.
54
+ */
55
+ export const normalizeExtensionName = (name) => {
56
+ const normalized = name
57
+ .trim()
58
+ .toLowerCase()
59
+ .replace(/[^a-z0-9]+/g, "-")
60
+ .replace(/^-+/, "")
61
+ .replace(/-+$/, "")
62
+ .slice(0, 64)
63
+ .replace(/-+$/, "");
64
+ return decodeExtensionNameSync(normalized || "unnamed-extension");
65
+ };
66
+ //# sourceMappingURL=extension-name.js.map
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Shared extension directory path helpers.
3
+ *
4
+ * @experimental This API is unstable and may change without notice.
5
+ */
6
+ import type { ExtensionTypePlural } from "@agentxm/extension-model/unstable/extensions/common";
7
+ import type { Handle } from "@agentxm/extension-model/unstable/extensions/handle";
8
+ import type { GitBasedSource, LocalSource, RegistrySource } from "@agentxm/extension-model/unstable/sources/types";
9
+ import { type AbsolutePath } from "@agentxm/extension-model/unstable/path-types";
10
+ import type { WorkspaceLayout } from "./layout.js";
11
+ export type ExtensionPathSource = {
12
+ readonly refType: "registry";
13
+ readonly owner: Handle;
14
+ readonly source: RegistrySource;
15
+ readonly portable?: false;
16
+ } | {
17
+ readonly refType: "workspace";
18
+ readonly owner: Handle;
19
+ readonly portable?: false;
20
+ } | {
21
+ readonly refType: "git-hosted";
22
+ readonly source: GitBasedSource;
23
+ readonly sourcePath?: string;
24
+ readonly portable?: boolean;
25
+ } | {
26
+ readonly refType: "local";
27
+ readonly source: LocalSource;
28
+ readonly sourcePath?: string;
29
+ readonly portable?: boolean;
30
+ };
31
+ export type ExtensionPathLockEntry = {
32
+ readonly type: "registry";
33
+ readonly sourceName: string;
34
+ readonly endpoint: URL;
35
+ readonly owner: Handle;
36
+ } | {
37
+ readonly type: "local";
38
+ readonly path: string;
39
+ readonly packageFormat: "agentxm" | "agent-skill";
40
+ } | {
41
+ readonly type: "github" | "gitlab" | "bitbucket";
42
+ readonly sourceName: string;
43
+ readonly endpoint: URL;
44
+ readonly owner: string;
45
+ readonly repo: string;
46
+ readonly path?: string | undefined;
47
+ readonly ref?: string | undefined;
48
+ readonly packageFormat: "agentxm" | "agent-skill";
49
+ } | {
50
+ readonly type: "azurerepos";
51
+ readonly sourceName: string;
52
+ readonly endpoint: URL;
53
+ readonly organization: string;
54
+ readonly project: string;
55
+ readonly repo: string;
56
+ readonly path?: string | undefined;
57
+ readonly ref?: string | undefined;
58
+ readonly packageFormat: "agentxm" | "agent-skill";
59
+ } | {
60
+ readonly type: "git";
61
+ readonly url: string;
62
+ readonly path?: string | undefined;
63
+ readonly ref?: string | undefined;
64
+ readonly packageFormat: "agentxm" | "agent-skill";
65
+ };
66
+ export declare const extensionPathSourceFromLockEntry: (entry: ExtensionPathLockEntry) => Exclude<ExtensionPathSource, {
67
+ readonly refType: "workspace";
68
+ }>;
69
+ export interface ExtensionDirPaths {
70
+ readonly canonicalPath: AbsolutePath;
71
+ readonly extensionSrcPath: AbsolutePath;
72
+ }
73
+ export declare const extensionContentFilename: (name: string) => string;
74
+ export declare const extensionContentPath: (join: (...paths: string[]) => string, root: string, name: string) => AbsolutePath;
75
+ /** Render a portable display path for an acquired extension package. */
76
+ export declare const acquiredExtensionDisplayPath: (root: string, source: Exclude<ExtensionPathSource, {
77
+ readonly refType: "workspace";
78
+ }>, type: ExtensionTypePlural, name: string) => string;
79
+ /** Render the acquired display path proven by a persisted lock entry. */
80
+ export declare const acquiredExtensionDisplayPathFromLockEntry: (root: string, entry: ExtensionPathLockEntry, type: ExtensionTypePlural, name: string) => string;
81
+ export declare const computeExtensionPathsForLayout: (join: (...paths: string[]) => string, layout: WorkspaceLayout, source: ExtensionPathSource, type: ExtensionTypePlural, sanitizedName: string) => ExtensionDirPaths;
82
+ //# sourceMappingURL=extension-paths.d.ts.map
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Shared extension directory path helpers.
3
+ *
4
+ * @experimental This API is unstable and may change without notice.
5
+ */
6
+ import * as Option from "effect/Option";
7
+ import { decodeAbsolutePathSync, } from "@agentxm/extension-model/unstable/path-types";
8
+ export const extensionPathSourceFromLockEntry = (entry) => {
9
+ switch (entry.type) {
10
+ case "registry":
11
+ return {
12
+ refType: "registry",
13
+ owner: entry.owner,
14
+ source: {
15
+ type: "registry",
16
+ name: entry.sourceName,
17
+ location: entry.endpoint,
18
+ owner: Option.some(entry.owner),
19
+ },
20
+ };
21
+ case "local":
22
+ return {
23
+ refType: "local",
24
+ source: { type: "local", path: entry.path },
25
+ sourcePath: entry.path,
26
+ portable: entry.packageFormat === "agent-skill",
27
+ };
28
+ case "github":
29
+ case "gitlab":
30
+ case "bitbucket":
31
+ return {
32
+ refType: "git-hosted",
33
+ source: {
34
+ type: entry.type,
35
+ name: entry.sourceName,
36
+ url: entry.endpoint,
37
+ owner: entry.owner,
38
+ repo: entry.repo,
39
+ ref: Option.fromUndefinedOr(entry.ref),
40
+ subPath: Option.fromUndefinedOr(entry.path),
41
+ },
42
+ ...(entry.path === undefined ? {} : { sourcePath: entry.path }),
43
+ portable: entry.packageFormat === "agent-skill",
44
+ };
45
+ case "azurerepos":
46
+ return {
47
+ refType: "git-hosted",
48
+ source: {
49
+ type: "azurerepos",
50
+ name: entry.sourceName,
51
+ url: entry.endpoint,
52
+ organization: entry.organization,
53
+ project: entry.project,
54
+ repo: entry.repo,
55
+ ref: Option.fromUndefinedOr(entry.ref),
56
+ subPath: Option.fromUndefinedOr(entry.path),
57
+ },
58
+ ...(entry.path === undefined ? {} : { sourcePath: entry.path }),
59
+ portable: entry.packageFormat === "agent-skill",
60
+ };
61
+ case "git":
62
+ return {
63
+ refType: "git-hosted",
64
+ source: {
65
+ type: "git",
66
+ url: new URL(entry.url),
67
+ ref: Option.fromUndefinedOr(entry.ref),
68
+ },
69
+ ...(entry.path === undefined ? {} : { sourcePath: entry.path }),
70
+ portable: entry.packageFormat === "agent-skill",
71
+ };
72
+ }
73
+ };
74
+ export const extensionContentFilename = (name) => `${name}.md`;
75
+ export const extensionContentPath = (join, root, name) => decodeAbsolutePathSync(join(root, extensionContentFilename(name)));
76
+ const sourcePathSegments = (value) => {
77
+ const segments = value
78
+ .replaceAll("\\", "/")
79
+ .split("/")
80
+ .filter((segment) => segment !== "" && segment !== ".");
81
+ if (segments.some((segment) => segment === "..")) {
82
+ throw new Error(`Extension source path cannot contain traversal segments: ${value}`);
83
+ }
84
+ return segments;
85
+ };
86
+ const localSourcePathSegments = (value) => value
87
+ .replaceAll("\\", "/")
88
+ .split("/")
89
+ .filter((segment) => segment !== "" && segment !== ".")
90
+ .map((segment) => (segment === ".." ? "%2E%2E" : encodeURIComponent(segment)));
91
+ const gitRepositorySegments = (url) => {
92
+ const pathSegments = sourcePathSegments(url.pathname);
93
+ const last = pathSegments.at(-1);
94
+ const repositorySegments = last?.endsWith(".git") === true
95
+ ? [...pathSegments.slice(0, -1), last.slice(0, -4)]
96
+ : pathSegments;
97
+ return [url.hostname, ...repositorySegments].filter((segment) => segment.length > 0);
98
+ };
99
+ const selectedSourcePath = (source) => source.sourcePath ??
100
+ (source.source.type === "git" ? undefined : Option.getOrUndefined(source.source.subPath));
101
+ const acquiredSourceSegments = (source) => {
102
+ switch (source.refType) {
103
+ case "registry":
104
+ return [source.source.name, source.owner];
105
+ case "local":
106
+ return ["local", ...localSourcePathSegments(source.sourcePath ?? source.source.path)];
107
+ case "git-hosted": {
108
+ const selected = selectedSourcePath(source);
109
+ const selectedSegments = selected === undefined ? [] : sourcePathSegments(selected);
110
+ switch (source.source.type) {
111
+ case "github":
112
+ case "gitlab":
113
+ case "bitbucket":
114
+ return [
115
+ source.source.name,
116
+ ...sourcePathSegments(source.source.owner),
117
+ source.source.repo,
118
+ ...selectedSegments,
119
+ ];
120
+ case "azurerepos":
121
+ return [
122
+ source.source.name,
123
+ source.source.organization,
124
+ source.source.project,
125
+ source.source.repo,
126
+ ...selectedSegments,
127
+ ];
128
+ case "git":
129
+ return ["git", ...gitRepositorySegments(source.source.url), ...selectedSegments];
130
+ }
131
+ }
132
+ }
133
+ };
134
+ /** Render a portable display path for an acquired extension package. */
135
+ export const acquiredExtensionDisplayPath = (root, source, type, name) => [
136
+ root.replace(/[\\/]+$/u, ""),
137
+ ...acquiredSourceSegments(source),
138
+ ...(source.refType === "registry" ? [type, name] : []),
139
+ ].join("/");
140
+ /** Render the acquired display path proven by a persisted lock entry. */
141
+ export const acquiredExtensionDisplayPathFromLockEntry = (root, entry, type, name) => acquiredExtensionDisplayPath(root, extensionPathSourceFromLockEntry(entry), type, name);
142
+ const extensionPathsAt = (join, canonicalPath, source, type) => ({
143
+ canonicalPath: decodeAbsolutePathSync(canonicalPath),
144
+ extensionSrcPath: decodeAbsolutePathSync(source.refType !== "workspace" && source.portable === true
145
+ ? canonicalPath
146
+ : type === "mcps" || type === "packs"
147
+ ? canonicalPath
148
+ : join(canonicalPath, "src")),
149
+ });
150
+ export const computeExtensionPathsForLayout = (join, layout, source, type, sanitizedName) => {
151
+ if (source.refType === "workspace") {
152
+ const canonicalPath = layout.scope === "project"
153
+ ? join(layout.authoredRoot(type === "mcps"
154
+ ? "mcp-server"
155
+ : type === "skills"
156
+ ? "skill"
157
+ : type === "subagents"
158
+ ? "subagent"
159
+ : type === "rules"
160
+ ? "rule"
161
+ : type === "hooks"
162
+ ? "hook"
163
+ : type === "knowledge"
164
+ ? "knowledge"
165
+ : "pack"), sanitizedName)
166
+ : join(layout.acquiredRoot, source.owner, type, sanitizedName);
167
+ return extensionPathsAt(join, canonicalPath, source, type);
168
+ }
169
+ const canonicalPath = join(layout.acquiredRoot, ...acquiredSourceSegments(source), ...(source.refType === "registry" ? [type, sanitizedName] : []));
170
+ return extensionPathsAt(join, canonicalPath, source, type);
171
+ };
172
+ //# sourceMappingURL=extension-paths.js.map