@agentxm/extension-materialization 0.28.14-preview.1789139351.5cd4595aa

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 (89) hide show
  1. package/LICENSE +110 -0
  2. package/README.md +16 -0
  3. package/dist/src/desired-state/errors.d.ts +22 -0
  4. package/dist/src/desired-state/errors.js +22 -0
  5. package/dist/src/desired-state/retained-materialization.d.ts +58 -0
  6. package/dist/src/desired-state/retained-materialization.js +119 -0
  7. package/dist/src/errors.d.ts +42 -0
  8. package/dist/src/errors.js +14 -0
  9. package/dist/src/extensions/canonical-directory.d.ts +106 -0
  10. package/dist/src/extensions/canonical-directory.js +210 -0
  11. package/dist/src/extensions/canonical-reuse.d.ts +43 -0
  12. package/dist/src/extensions/canonical-reuse.js +38 -0
  13. package/dist/src/extensions/copy-directory.d.ts +50 -0
  14. package/dist/src/extensions/copy-directory.js +78 -0
  15. package/dist/src/extensions/errors.d.ts +97 -0
  16. package/dist/src/extensions/errors.js +42 -0
  17. package/dist/src/extensions/materializable-from-disk.d.ts +37 -0
  18. package/dist/src/extensions/materializable-from-disk.js +89 -0
  19. package/dist/src/extensions/operations.d.ts +252 -0
  20. package/dist/src/extensions/operations.js +631 -0
  21. package/dist/src/hooks/errors.d.ts +33 -0
  22. package/dist/src/hooks/errors.js +18 -0
  23. package/dist/src/hooks/manager.d.ts +13 -0
  24. package/dist/src/hooks/manager.js +778 -0
  25. package/dist/src/index.d.ts +44 -0
  26. package/dist/src/index.js +56 -0
  27. package/dist/src/knowledge/errors.d.ts +75 -0
  28. package/dist/src/knowledge/errors.js +36 -0
  29. package/dist/src/knowledge/manager.d.ts +9 -0
  30. package/dist/src/knowledge/manager.js +709 -0
  31. package/dist/src/live.d.ts +20 -0
  32. package/dist/src/live.js +20 -0
  33. package/dist/src/manager-contract.d.ts +136 -0
  34. package/dist/src/manager-contract.js +19 -0
  35. package/dist/src/manager-registry-live.d.ts +11 -0
  36. package/dist/src/manager-registry-live.js +23 -0
  37. package/dist/src/manager-registry.d.ts +37 -0
  38. package/dist/src/manager-registry.js +22 -0
  39. package/dist/src/managers.d.ts +147 -0
  40. package/dist/src/managers.js +32 -0
  41. package/dist/src/mcps/artifact.d.ts +24 -0
  42. package/dist/src/mcps/artifact.js +74 -0
  43. package/dist/src/mcps/authored-materialization.d.ts +28 -0
  44. package/dist/src/mcps/authored-materialization.js +34 -0
  45. package/dist/src/mcps/errors.d.ts +105 -0
  46. package/dist/src/mcps/errors.js +40 -0
  47. package/dist/src/mcps/install-operation.d.ts +92 -0
  48. package/dist/src/mcps/install-operation.js +557 -0
  49. package/dist/src/mcps/manager.d.ts +15 -0
  50. package/dist/src/mcps/manager.js +253 -0
  51. package/dist/src/mcps/native-entry.d.ts +51 -0
  52. package/dist/src/mcps/native-entry.js +100 -0
  53. package/dist/src/mcps/secret-store-live.d.ts +14 -0
  54. package/dist/src/mcps/secret-store-live.js +58 -0
  55. package/dist/src/mcps/secret-store.d.ts +55 -0
  56. package/dist/src/mcps/secret-store.js +33 -0
  57. package/dist/src/packs/errors.d.ts +50 -0
  58. package/dist/src/packs/errors.js +24 -0
  59. package/dist/src/packs/manager.d.ts +16 -0
  60. package/dist/src/packs/manager.js +189 -0
  61. package/dist/src/projection-participants-live.d.ts +17 -0
  62. package/dist/src/projection-participants-live.js +66 -0
  63. package/dist/src/projection-step-failure.d.ts +19 -0
  64. package/dist/src/projection-step-failure.js +76 -0
  65. package/dist/src/registry-materialization.d.ts +52 -0
  66. package/dist/src/registry-materialization.js +67 -0
  67. package/dist/src/rules/errors.d.ts +31 -0
  68. package/dist/src/rules/errors.js +17 -0
  69. package/dist/src/rules/manager.d.ts +18 -0
  70. package/dist/src/rules/manager.js +492 -0
  71. package/dist/src/skills/errors.d.ts +42 -0
  72. package/dist/src/skills/errors.js +21 -0
  73. package/dist/src/skills/manager.d.ts +17 -0
  74. package/dist/src/skills/manager.js +339 -0
  75. package/dist/src/skills/materialization.d.ts +52 -0
  76. package/dist/src/skills/materialization.js +168 -0
  77. package/dist/src/skills/skill-artifact.d.ts +38 -0
  78. package/dist/src/skills/skill-artifact.js +70 -0
  79. package/dist/src/skills/source-hash.d.ts +2 -0
  80. package/dist/src/skills/source-hash.js +6 -0
  81. package/dist/src/subagents/errors.d.ts +43 -0
  82. package/dist/src/subagents/errors.js +20 -0
  83. package/dist/src/subagents/lock-entry-builder.d.ts +20 -0
  84. package/dist/src/subagents/lock-entry-builder.js +63 -0
  85. package/dist/src/subagents/manager.d.ts +17 -0
  86. package/dist/src/subagents/manager.js +736 -0
  87. package/dist/src/testing.d.ts +87 -0
  88. package/dist/src/testing.js +116 -0
  89. package/package.json +70 -0
@@ -0,0 +1,2 @@
1
+ export declare const computeSkillSourceHash: (packageDir: string) => import("effect/Effect").Effect<import("@agentxm/extension-model/unstable/sources/source-hash").SourceHash, import("@agentxm/workspace-state").PackageContentHashFailed, import("effect/FileSystem").FileSystem | import("effect/Path").Path>;
2
+ //# sourceMappingURL=source-hash.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { computePackageContentHash } from "@agentxm/workspace-state";
2
+ // Source hashes are advisory change markers. Reusing the package-content
3
+ // algorithm gives every relative path and byte sequence an unambiguous NUL-
4
+ // separated representation.
5
+ export const computeSkillSourceHash = computePackageContentHash;
6
+ //# sourceMappingURL=source-hash.js.map
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Typed failure family for the subagent manager. Fields are domain facts; the
3
+ * application error boundary owns rendering, codes, and suggestions.
4
+ *
5
+ * @experimental This API is unstable and may change without notice.
6
+ */
7
+ import type { SubagentIoFailed } from "@agentxm/agent-integration";
8
+ declare const SubagentDefinitionInvalid_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 & {
9
+ readonly _tag: "SubagentDefinitionInvalid";
10
+ } & Readonly<A>;
11
+ /**
12
+ * A subagent package, source, or binding did not validate. `detail` carries
13
+ * the site's fact sentence verbatim.
14
+ */
15
+ export declare class SubagentDefinitionInvalid extends SubagentDefinitionInvalid_base<{
16
+ readonly detail: string;
17
+ readonly cause?: unknown;
18
+ }> {
19
+ }
20
+ declare const SubagentContentUnreadable_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 & {
21
+ readonly _tag: "SubagentContentUnreadable";
22
+ } & Readonly<A>;
23
+ /** The canonical subagent content file could not be read. */
24
+ export declare class SubagentContentUnreadable extends SubagentContentUnreadable_base<{
25
+ readonly expectedFilename: string;
26
+ readonly subagentSrcPath: string;
27
+ readonly contentPath: string;
28
+ readonly cause: unknown;
29
+ }> {
30
+ }
31
+ declare const SubagentInstallStateMissing_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 & {
32
+ readonly _tag: "SubagentInstallStateMissing";
33
+ } & Readonly<A>;
34
+ /** A lock entry was requested before install recorded the package state. */
35
+ export declare class SubagentInstallStateMissing extends SubagentInstallStateMissing_base<{
36
+ readonly name: string;
37
+ readonly kind: "content-identity" | "external-resolution";
38
+ }> {
39
+ }
40
+ /** Every failure the subagent manager constructs. */
41
+ export type SubagentManagerError = SubagentDefinitionInvalid | SubagentContentUnreadable | SubagentIoFailed | SubagentInstallStateMissing;
42
+ export {};
43
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Typed failure family for the subagent manager. Fields are domain facts; the
3
+ * application error boundary owns rendering, codes, and suggestions.
4
+ *
5
+ * @experimental This API is unstable and may change without notice.
6
+ */
7
+ import * as Data from "effect/Data";
8
+ /**
9
+ * A subagent package, source, or binding did not validate. `detail` carries
10
+ * the site's fact sentence verbatim.
11
+ */
12
+ export class SubagentDefinitionInvalid extends Data.TaggedError("SubagentDefinitionInvalid") {
13
+ }
14
+ /** The canonical subagent content file could not be read. */
15
+ export class SubagentContentUnreadable extends Data.TaggedError("SubagentContentUnreadable") {
16
+ }
17
+ /** A lock entry was requested before install recorded the package state. */
18
+ export class SubagentInstallStateMissing extends Data.TaggedError("SubagentInstallStateMissing") {
19
+ }
20
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Maps a SubagentExtensionRef to a SubagentLockEntry for lockfile persistence.
3
+ *
4
+ * Follows the same structural pattern as sourceToLockEntry for skills and
5
+ * buildLockEntryFromRef for commands.
6
+ *
7
+ * @experimental This API is unstable and may change without notice.
8
+ */
9
+ import * as Option from "effect/Option";
10
+ import type { SourceHash } from "@agentxm/extension-model/unstable/sources/source-hash";
11
+ import type { TreeIntegrity } from "@agentxm/workspace-state";
12
+ import type { SubagentLockEntry } from "@agentxm/workspace-state";
13
+ import type { SubagentExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/subagent";
14
+ /**
15
+ * Build a SubagentLockEntry from any ref type.
16
+ *
17
+ * @experimental This API is unstable and may change without notice.
18
+ */
19
+ export declare const buildSubagentLockEntry: (ref: SubagentExtensionRef, contentIdentity: SourceHash, treeIntegrity: TreeIntegrity, workspaceRelativeLocalSourcePath?: Option.Option<string>) => SubagentLockEntry | undefined;
20
+ //# sourceMappingURL=lock-entry-builder.d.ts.map
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Maps a SubagentExtensionRef to a SubagentLockEntry for lockfile persistence.
3
+ *
4
+ * Follows the same structural pattern as sourceToLockEntry for skills and
5
+ * buildLockEntryFromRef for commands.
6
+ *
7
+ * @experimental This API is unstable and may change without notice.
8
+ */
9
+ import * as Option from "effect/Option";
10
+ import { gitSourceLockFields } from "@agentxm/workspace-state";
11
+ // -----------------------------------------------------------------------------
12
+ // Helpers
13
+ // -----------------------------------------------------------------------------
14
+ const localSourceLockPath = (sourcePath, workspaceRelativeLocalSourcePath) => Option.getOrElse(workspaceRelativeLocalSourcePath, () => sourcePath);
15
+ // -----------------------------------------------------------------------------
16
+ // Implementation
17
+ // -----------------------------------------------------------------------------
18
+ /**
19
+ * Build a SubagentLockEntry from any ref type.
20
+ *
21
+ * @experimental This API is unstable and may change without notice.
22
+ */
23
+ export const buildSubagentLockEntry = (ref, contentIdentity, treeIntegrity, workspaceRelativeLocalSourcePath = Option.none()) => {
24
+ switch (ref.refType) {
25
+ case "git-hosted":
26
+ return {
27
+ ...gitSourceLockFields(ref.source, "subagent", ref.subagent.name, Option.fromUndefinedOr(ref.sourcePath), ref.gitCommitSha, ref.gitTreeSha, contentIdentity, ref.owner, ref.name, treeIntegrity),
28
+ };
29
+ case "local":
30
+ return {
31
+ type: "local",
32
+ sourceType: "local",
33
+ sourceName: "local",
34
+ extensionType: "subagent",
35
+ workspaceName: ref.subagent.name,
36
+ packageFormat: "agentxm",
37
+ packageOwner: ref.owner,
38
+ packageName: ref.name,
39
+ path: localSourceLockPath(ref.source.path, workspaceRelativeLocalSourcePath),
40
+ contentIdentity,
41
+ treeIntegrity,
42
+ };
43
+ case "registry":
44
+ return {
45
+ type: "registry",
46
+ sourceType: "registry",
47
+ packageFormat: "agentxm",
48
+ endpoint: ref.source.location,
49
+ extensionType: "subagent",
50
+ workspaceName: ref.subagent.name,
51
+ owner: ref.owner,
52
+ name: ref.subagent.name,
53
+ resolvedVersion: ref.version,
54
+ integrity: Option.getOrElse(ref.integrity, () => ""),
55
+ sourceName: ref.source.name,
56
+ publisherBindingId: ref.publisherBindingId,
57
+ treeIntegrity,
58
+ };
59
+ case "workspace":
60
+ return undefined;
61
+ }
62
+ };
63
+ //# sourceMappingURL=lock-entry-builder.js.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Subagent extension manager service.
3
+ *
4
+ * Implements ExtensionManager<SubagentExtensionRef> with canonical source
5
+ * materialization, per-agent rendering via CodingAgent.addSubagent(),
6
+ * and source-hash-based skip logic.
7
+ *
8
+ * @experimental This API is unstable and may change without notice.
9
+ */
10
+ import * as FileSystem from "effect/FileSystem";
11
+ import * as Path from "effect/Path";
12
+ import * as Layer from "effect/Layer";
13
+ import { WorkspaceMutations } from "@agentxm/workspace-state";
14
+ import { CodingAgentRepository } from "@agentxm/workspace-projection";
15
+ import { SubagentManager } from "../managers.js";
16
+ export declare const SubagentManagerLive: Layer.Layer<SubagentManager, never, FileSystem.FileSystem | Path.Path | WorkspaceMutations | CodingAgentRepository>;
17
+ //# sourceMappingURL=manager.d.ts.map