@agentxm/extension-authoring 0.28.11 → 0.28.13

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 (75) hide show
  1. package/dist/src/adopt/adopt-extension.d.ts +71 -0
  2. package/dist/src/adopt/adopt-extension.js +174 -0
  3. package/dist/src/authored-declaration.d.ts +49 -0
  4. package/dist/src/authored-declaration.js +86 -0
  5. package/dist/src/authored-package-errors.d.ts +91 -0
  6. package/dist/src/authored-package-errors.js +36 -0
  7. package/dist/src/create/authoring-owner.d.ts +54 -0
  8. package/dist/src/create/authoring-owner.js +93 -0
  9. package/dist/src/create/create-extension.d.ts +127 -0
  10. package/dist/src/create/create-extension.js +440 -0
  11. package/dist/src/create/errors.d.ts +59 -0
  12. package/dist/src/create/errors.js +54 -0
  13. package/dist/src/create/scaffold-name.d.ts +15 -0
  14. package/dist/src/create/scaffold-name.js +16 -0
  15. package/dist/src/create/scaffolds/hook.d.ts +19 -0
  16. package/dist/src/create/scaffolds/hook.js +118 -0
  17. package/dist/src/create/scaffolds/knowledge.d.ts +14 -0
  18. package/dist/src/create/scaffolds/knowledge.js +45 -0
  19. package/dist/src/create/scaffolds/mcp-server.d.ts +17 -0
  20. package/dist/src/create/scaffolds/mcp-server.js +57 -0
  21. package/dist/src/create/scaffolds/pack.d.ts +13 -0
  22. package/dist/src/create/scaffolds/pack.js +37 -0
  23. package/dist/src/create/scaffolds/rule.d.ts +14 -0
  24. package/dist/src/create/scaffolds/rule.js +46 -0
  25. package/dist/src/create/scaffolds/scaffold.d.ts +51 -0
  26. package/dist/src/create/scaffolds/scaffold.js +45 -0
  27. package/dist/src/create/scaffolds/skill.d.ts +12 -0
  28. package/dist/src/create/scaffolds/skill.js +47 -0
  29. package/dist/src/create/scaffolds/subagent.d.ts +12 -0
  30. package/dist/src/create/scaffolds/subagent.js +47 -0
  31. package/dist/src/create-preflight.d.ts +3 -2
  32. package/dist/src/create-preflight.js +2 -1
  33. package/dist/src/errors.d.ts +1 -1
  34. package/dist/src/errors.js +1 -1
  35. package/dist/src/fork/fork-extension.d.ts +87 -0
  36. package/dist/src/fork/fork-extension.js +253 -0
  37. package/dist/src/fork-package.d.ts +2 -2
  38. package/dist/src/fork-package.js +4 -4
  39. package/dist/src/import/import-native-extension.d.ts +119 -0
  40. package/dist/src/import/import-native-extension.js +310 -0
  41. package/dist/src/import-native-package.d.ts +2 -2
  42. package/dist/src/import-native-package.js +4 -4
  43. package/dist/src/index.d.ts +20 -11
  44. package/dist/src/index.js +26 -13
  45. package/dist/src/packs/add-to-pack.d.ts +2 -2
  46. package/dist/src/packs/add-to-pack.js +4 -3
  47. package/dist/src/packs/change-pack-membership.d.ts +56 -0
  48. package/dist/src/packs/change-pack-membership.js +246 -0
  49. package/dist/src/packs/configured-pack-selector.d.ts +24 -0
  50. package/dist/src/packs/configured-pack-selector.js +53 -0
  51. package/dist/src/packs/glob.d.ts +14 -0
  52. package/dist/src/packs/glob.js +44 -0
  53. package/dist/src/packs/membership-errors.d.ts +122 -0
  54. package/dist/src/packs/membership-errors.js +47 -0
  55. package/dist/src/packs/remove-from-pack.d.ts +2 -2
  56. package/dist/src/packs/remove-from-pack.js +4 -3
  57. package/dist/src/step-failure.d.ts +31 -0
  58. package/dist/src/step-failure.js +253 -0
  59. package/dist/src/testing.d.ts +68 -0
  60. package/dist/src/testing.js +135 -0
  61. package/dist/src/version/change-authored-version.d.ts +73 -0
  62. package/dist/src/version/change-authored-version.js +224 -0
  63. package/dist/src/version/errors.d.ts +65 -0
  64. package/dist/src/version/errors.js +73 -0
  65. package/package.json +23 -8
  66. package/dist/src/desired-identity.d.ts +0 -19
  67. package/dist/src/desired-identity.js +0 -26
  68. package/dist/src/failure-adapter.d.ts +0 -31
  69. package/dist/src/failure-adapter.js +0 -23
  70. package/dist/src/hooks/new-hook.d.ts +0 -46
  71. package/dist/src/hooks/new-hook.js +0 -164
  72. package/dist/src/packs/new-pack.d.ts +0 -37
  73. package/dist/src/packs/new-pack.js +0 -90
  74. package/dist/src/skills/new-skill.d.ts +0 -38
  75. package/dist/src/skills/new-skill.js +0 -102
@@ -0,0 +1,224 @@
1
+ /**
2
+ * Changing the version an authored manifest declares.
3
+ *
4
+ * A version is one field of one manifest the workspace authors, so this use
5
+ * case decides three things: that the named package really is authored here,
6
+ * what the next version is, and that nothing else in the manifest moves. The
7
+ * write runs inside the workspace transaction like every other authoring
8
+ * change, so an interrupted or failed bump restores the manifest rather than
9
+ * leaving a half-written file, and the operation reports the real resolution
10
+ * the transaction settled with.
11
+ *
12
+ * `prepare` reads the manifest, settles `from` and `to`, and writes nothing.
13
+ * `previewOrApply` resolves that candidate; a bump to the version the manifest
14
+ * already carries settles as unchanged rather than rewriting the file.
15
+ *
16
+ * @experimental This API is unstable and may change without notice.
17
+ */
18
+ import * as Effect from "effect/Effect";
19
+ import * as FileSystem from "effect/FileSystem";
20
+ import * as Option from "effect/Option";
21
+ import * as Path from "effect/Path";
22
+ import * as Schema from "effect/Schema";
23
+ import * as semver from "semver";
24
+ import { manifestFilenameForType } from "@agentxm/extension-content";
25
+ import { extensionTypeSentenceLabels, extensionTypeToPlural, formatFqn, parseFqn, } from "@agentxm/extension-model/unstable/extensions";
26
+ import { isWorkspaceSourceLocator } from "@agentxm/extension-model/unstable/sources/workspace";
27
+ import { VersionSchema } from "@agentxm/extension-model/unstable/version-constraints";
28
+ import { operationPresentation, prepareExecutionCandidate, resolveExecutionCandidate, } from "@agentxm/workspace-operations";
29
+ import { WorkspaceMutations, } from "@agentxm/workspace-state";
30
+ import { runWorkspaceTransaction, } from "@agentxm/workspace-transactions";
31
+ import { authoredDeclaration } from "../authored-declaration.js";
32
+ import { AuthoringFailed } from "../errors.js";
33
+ import { AuthoringScopeUnsupported } from "../create/errors.js";
34
+ import { authoringStepFailure } from "../step-failure.js";
35
+ import { AuthoredManifestUnavailable, authoredManifestUnavailableCategory, authoredManifestUnavailableDetail, VersionTargetIdentityMismatch, VersionTargetInvalid, VersionTargetNotAuthored, } from "./errors.js";
36
+ // -----------------------------------------------------------------------------
37
+ // Manifest access
38
+ // -----------------------------------------------------------------------------
39
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
40
+ const decodeExactVersion = (value, manifestPath) => Schema.decodeUnknownEffect(VersionSchema)(value).pipe(Effect.mapError((cause) => new AuthoredManifestUnavailable({ manifestPath, reason: "invalid", cause })));
41
+ /** Read one authored manifest as its raw text and its decoded object. */
42
+ const readManifest = Effect.fn("ChangeAuthoredVersion.readManifest")(function* (args) {
43
+ const fs = yield* FileSystem.FileSystem;
44
+ const exists = yield* fs.exists(args.absolutePath).pipe(Effect.orElseSucceed(() => false));
45
+ if (!exists) {
46
+ return yield* new AuthoredManifestUnavailable({
47
+ manifestPath: args.manifestPath,
48
+ reason: "missing",
49
+ createCommand: args.createCommand,
50
+ });
51
+ }
52
+ const content = yield* fs.readFileString(args.absolutePath).pipe(Effect.mapError((cause) => new AuthoredManifestUnavailable({
53
+ manifestPath: args.manifestPath,
54
+ reason: "unreadable",
55
+ cause,
56
+ })));
57
+ const parsed = yield* Effect.try({
58
+ try: () => JSON.parse(content),
59
+ catch: (cause) => new AuthoredManifestUnavailable({
60
+ manifestPath: args.manifestPath,
61
+ reason: "unparsable",
62
+ cause,
63
+ }),
64
+ });
65
+ if (!isRecord(parsed)) {
66
+ return yield* new AuthoredManifestUnavailable({
67
+ manifestPath: args.manifestPath,
68
+ reason: "invalid",
69
+ });
70
+ }
71
+ return { content, manifest: Object.fromEntries(Object.entries(parsed)) };
72
+ });
73
+ /**
74
+ * The next version this request asks for.
75
+ *
76
+ * An exact version must itself be an exact version: a range like `^2.0.0`
77
+ * names a set of releases, and a manifest declares one.
78
+ */
79
+ const nextVersion = (from, change, manifestPath) => {
80
+ if (change._tag === "Exact") {
81
+ return Schema.decodeUnknownEffect(VersionSchema)(change.version).pipe(Effect.mapError(() => new VersionTargetInvalid({
82
+ detail: `"${change.version}" is not an exact version`,
83
+ recover: "Pass an exact semver version, for example 1.2.3.",
84
+ })));
85
+ }
86
+ const incremented = semver.inc(from, change.rule);
87
+ return incremented === null
88
+ ? Effect.fail(new VersionTargetInvalid({
89
+ detail: `Version "${from}" cannot take a ${change.rule} bump`,
90
+ }))
91
+ : decodeExactVersion(incremented, manifestPath);
92
+ };
93
+ /**
94
+ * Inside the transaction the manifest is re-read, so its unavailability
95
+ * becomes an authoring failure the closure reports rather than a refusal the
96
+ * request phase settles.
97
+ */
98
+ const manifestUnavailableInClosure = (failure) => new AuthoringFailed({
99
+ category: authoredManifestUnavailableCategory(failure),
100
+ detail: authoredManifestUnavailableDetail(failure),
101
+ ...(failure.cause === undefined ? {} : { cause: failure.cause }),
102
+ });
103
+ /** The plan a version change resolves. */
104
+ export const changeAuthoredVersionPlanName = "Update extension version";
105
+ // -----------------------------------------------------------------------------
106
+ // prepare
107
+ // -----------------------------------------------------------------------------
108
+ /** Settle a version change without writing anything. */
109
+ export const prepareChangeAuthoredVersion = Effect.fn("ChangeAuthoredVersion.prepare")(function* (request) {
110
+ const ws = yield* WorkspaceMutations;
111
+ const path = yield* Path.Path;
112
+ const parsed = yield* Effect.fromResult(parseFqn(request.fqn));
113
+ if (ws.layout.scope !== "project") {
114
+ return yield* new AuthoringScopeUnsupported({ subject: "version", scope: ws.layout.scope });
115
+ }
116
+ const fqn = formatFqn(parsed);
117
+ const subject = extensionTypeSentenceLabels[parsed.type];
118
+ // Only a package this workspace declares as its own may have its manifest
119
+ // version changed; an acquired package's version is the publisher's.
120
+ const declaration = authoredDeclaration(ws, parsed.type, parsed.name);
121
+ const configuredSource = yield* declaration.read.pipe(Effect.map((current) => current.source));
122
+ if (Option.isNone(configuredSource) || !isWorkspaceSourceLocator(configuredSource.value)) {
123
+ return yield* new VersionTargetNotAuthored({
124
+ fqn,
125
+ subject,
126
+ ...(Option.isNone(configuredSource) ? {} : { configuredSource: configuredSource.value }),
127
+ });
128
+ }
129
+ const absolutePath = path.join(ws.layout.authoredRoot(parsed.type), parsed.name, manifestFilenameForType(parsed.type));
130
+ const manifestPath = path.relative(ws.baseDir, absolutePath);
131
+ const createCommand = `axm ${extensionTypeToPlural[parsed.type]} new`;
132
+ const { manifest } = yield* readManifest({ absolutePath, manifestPath, createCommand });
133
+ if (manifest["owner"] !== parsed.owner ||
134
+ manifest["type"] !== parsed.type ||
135
+ manifest["name"] !== parsed.name) {
136
+ return yield* new VersionTargetIdentityMismatch({ fqn, manifestPath });
137
+ }
138
+ const from = yield* decodeExactVersion(manifest["version"], manifestPath);
139
+ const to = yield* nextVersion(from, request.change, manifestPath);
140
+ const unchanged = from === to;
141
+ const artifact = {
142
+ path: manifestPath,
143
+ scope: ws.scope,
144
+ version: to,
145
+ previousVersion: from,
146
+ change: unchanged ? "unchanged" : "updated",
147
+ ...(unchanged ? {} : { fileCount: 1 }),
148
+ };
149
+ const step = {
150
+ readiness: "ready",
151
+ label: fqn,
152
+ message: `${from} -> ${to}`,
153
+ artifact,
154
+ run: runWorkspaceTransaction({
155
+ targets: [absolutePath],
156
+ transition: Effect.gen(function* () {
157
+ if (unchanged)
158
+ return;
159
+ const fs = yield* FileSystem.FileSystem;
160
+ // The candidate was settled against the manifest as it was read; a
161
+ // manifest that moved since then is a different decision, so the
162
+ // transaction refuses rather than overwriting the newer content.
163
+ const current = yield* readManifest({ absolutePath, manifestPath, createCommand }).pipe(Effect.mapError(manifestUnavailableInClosure));
164
+ const currentVersion = yield* decodeExactVersion(current.manifest["version"], manifestPath).pipe(Effect.mapError(manifestUnavailableInClosure));
165
+ if (currentVersion !== from) {
166
+ return yield* new AuthoringFailed({
167
+ category: "conflict",
168
+ detail: `Manifest version changed to ${currentVersion} before the bump could be applied: ${manifestPath}`,
169
+ });
170
+ }
171
+ const newline = current.content.endsWith("\n") ? "\n" : "";
172
+ yield* fs
173
+ .writeFileString(absolutePath, `${JSON.stringify({ ...current.manifest, version: to }, null, 2)}${newline}`)
174
+ .pipe(Effect.mapError((cause) => new AuthoringFailed({
175
+ category: "internal",
176
+ detail: `Failed to write manifest: ${manifestPath}`,
177
+ cause,
178
+ })));
179
+ }),
180
+ validate: () => Effect.gen(function* () {
181
+ const current = yield* readManifest({ absolutePath, manifestPath, createCommand }).pipe(Effect.mapError(manifestUnavailableInClosure));
182
+ const currentVersion = yield* decodeExactVersion(current.manifest["version"], manifestPath).pipe(Effect.mapError(manifestUnavailableInClosure));
183
+ if (currentVersion !== to) {
184
+ return yield* new AuthoringFailed({
185
+ category: "internal",
186
+ detail: `Manifest ${manifestPath} declares ${currentVersion} after the bump to ${to}`,
187
+ });
188
+ }
189
+ }),
190
+ }).pipe(Effect.mapError(authoringStepFailure), Effect.as({
191
+ result: "success",
192
+ message: `Updated ${subject} ${fqn} ${from} -> ${to}`,
193
+ ...(unchanged ? { disposition: "unchanged" } : {}),
194
+ artifact,
195
+ })),
196
+ };
197
+ const plan = {
198
+ _tag: "Plan",
199
+ name: changeAuthoredVersionPlanName,
200
+ description: Option.some(`Set ${fqn} to ${to}`),
201
+ presentation: operationPresentation({ imperative: "update", past: "Updated", gerund: "Updating" }, parsed.type),
202
+ jobs: [{ concurrency: 1, steps: [step] }],
203
+ };
204
+ return {
205
+ type: parsed.type,
206
+ fqn,
207
+ manifestPath,
208
+ from,
209
+ to,
210
+ unchanged,
211
+ execution: yield* prepareExecutionCandidate(plan),
212
+ };
213
+ });
214
+ // -----------------------------------------------------------------------------
215
+ // previewOrApply
216
+ // -----------------------------------------------------------------------------
217
+ /** Preview or apply a settled version change, resolving to one operation outcome. */
218
+ export const previewOrApplyChangeAuthoredVersion = (candidate, execution) => resolveExecutionCandidate(candidate.execution, execution);
219
+ /** The version-change use case: settle a request, then preview or apply it. */
220
+ export const ChangeAuthoredVersion = {
221
+ prepare: prepareChangeAuthoredVersion,
222
+ previewOrApply: previewOrApplyChangeAuthoredVersion,
223
+ };
224
+ //# sourceMappingURL=change-authored-version.js.map
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Typed refusals a version change can settle with.
3
+ *
4
+ * Each one carries the facts a person needs to recover — the identity they
5
+ * named, the source the workspace records for it, the manifest that could not
6
+ * be read — and none carries rendered prose. The application boundary owns the
7
+ * sentence; the feature owns the decision.
8
+ *
9
+ * @experimental This API is unstable and may change without notice.
10
+ */
11
+ import * as Schema from "effect/Schema";
12
+ declare const VersionTargetNotAuthored_base: Schema.Class<VersionTargetNotAuthored, Schema.TaggedStruct<"VersionTargetNotAuthored", {
13
+ /** Owner-qualified identity the person named. */
14
+ readonly fqn: Schema.String;
15
+ /** Sentence-cased subject, e.g. `skill`. */
16
+ readonly subject: Schema.String;
17
+ /** The source the workspace records, when it records one. */
18
+ readonly configuredSource: Schema.optional<Schema.String>;
19
+ }>, import("effect/Cause").YieldableError>;
20
+ /**
21
+ * The named package is not one this workspace authors: either nothing
22
+ * declares the name, or its declaration names a source outside workspace
23
+ * authorship. Only an authored manifest has a version this workspace may set.
24
+ */
25
+ export declare class VersionTargetNotAuthored extends VersionTargetNotAuthored_base {
26
+ }
27
+ declare const VersionTargetIdentityMismatch_base: Schema.Class<VersionTargetIdentityMismatch, Schema.TaggedStruct<"VersionTargetIdentityMismatch", {
28
+ /** Owner-qualified identity the person named. */
29
+ readonly fqn: Schema.String;
30
+ /** Path of the manifest that disagrees, relative to the workspace root. */
31
+ readonly manifestPath: Schema.String;
32
+ }>, import("effect/Cause").YieldableError>;
33
+ /** The authored manifest at the canonical location describes a different package. */
34
+ export declare class VersionTargetIdentityMismatch extends VersionTargetIdentityMismatch_base {
35
+ }
36
+ declare const VersionTargetInvalid_base: Schema.Class<VersionTargetInvalid, Schema.TaggedStruct<"VersionTargetInvalid", {
37
+ readonly detail: Schema.String;
38
+ /** What a valid value looks like, when there is one to name. */
39
+ readonly recover: Schema.optional<Schema.String>;
40
+ }>, import("effect/Cause").YieldableError>;
41
+ /** The requested target or version is not one a manifest can carry. */
42
+ export declare class VersionTargetInvalid extends VersionTargetInvalid_base {
43
+ }
44
+ declare const AuthoredManifestUnavailable_base: Schema.Class<AuthoredManifestUnavailable, Schema.TaggedStruct<"AuthoredManifestUnavailable", {
45
+ /** Path of the manifest, relative to the workspace root. */
46
+ readonly manifestPath: Schema.String;
47
+ readonly reason: Schema.Literals<readonly ["missing", "unreadable", "unparsable", "invalid"]>;
48
+ /** The command that would create the package, when it is missing. */
49
+ readonly createCommand: Schema.optional<Schema.String>;
50
+ readonly cause: Schema.optional<Schema.Unknown>;
51
+ }>, import("effect/Cause").YieldableError>;
52
+ /** The authored manifest could not be read, parsed, or decoded. */
53
+ export declare class AuthoredManifestUnavailable extends AuthoredManifestUnavailable_base {
54
+ }
55
+ /**
56
+ * The fact sentence an unavailable manifest reports. The producer owns it so
57
+ * the transaction closure and the application boundary say the same thing.
58
+ */
59
+ export declare const authoredManifestUnavailableDetail: (failure: AuthoredManifestUnavailable) => string;
60
+ /** The error category an unavailable manifest is reported under. */
61
+ export declare const authoredManifestUnavailableCategory: (failure: AuthoredManifestUnavailable) => "internal" | "not_found" | "validation";
62
+ /** Every typed refusal settling a version change can surface. */
63
+ export type AuthoredVersionError = VersionTargetNotAuthored | VersionTargetIdentityMismatch | VersionTargetInvalid | AuthoredManifestUnavailable;
64
+ export {};
65
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Typed refusals a version change can settle with.
3
+ *
4
+ * Each one carries the facts a person needs to recover — the identity they
5
+ * named, the source the workspace records for it, the manifest that could not
6
+ * be read — and none carries rendered prose. The application boundary owns the
7
+ * sentence; the feature owns the decision.
8
+ *
9
+ * @experimental This API is unstable and may change without notice.
10
+ */
11
+ import * as Schema from "effect/Schema";
12
+ /**
13
+ * The named package is not one this workspace authors: either nothing
14
+ * declares the name, or its declaration names a source outside workspace
15
+ * authorship. Only an authored manifest has a version this workspace may set.
16
+ */
17
+ export class VersionTargetNotAuthored extends Schema.TaggedError()("VersionTargetNotAuthored", {
18
+ /** Owner-qualified identity the person named. */
19
+ fqn: Schema.String,
20
+ /** Sentence-cased subject, e.g. `skill`. */
21
+ subject: Schema.String,
22
+ /** The source the workspace records, when it records one. */
23
+ configuredSource: Schema.optional(Schema.String),
24
+ }) {
25
+ }
26
+ /** The authored manifest at the canonical location describes a different package. */
27
+ export class VersionTargetIdentityMismatch extends Schema.TaggedError()("VersionTargetIdentityMismatch", {
28
+ /** Owner-qualified identity the person named. */
29
+ fqn: Schema.String,
30
+ /** Path of the manifest that disagrees, relative to the workspace root. */
31
+ manifestPath: Schema.String,
32
+ }) {
33
+ }
34
+ /** The requested target or version is not one a manifest can carry. */
35
+ export class VersionTargetInvalid extends Schema.TaggedError()("VersionTargetInvalid", {
36
+ detail: Schema.String,
37
+ /** What a valid value looks like, when there is one to name. */
38
+ recover: Schema.optional(Schema.String),
39
+ }) {
40
+ }
41
+ /** The authored manifest could not be read, parsed, or decoded. */
42
+ export class AuthoredManifestUnavailable extends Schema.TaggedError()("AuthoredManifestUnavailable", {
43
+ /** Path of the manifest, relative to the workspace root. */
44
+ manifestPath: Schema.String,
45
+ reason: Schema.Literals(["missing", "unreadable", "unparsable", "invalid"]),
46
+ /** The command that would create the package, when it is missing. */
47
+ createCommand: Schema.optional(Schema.String),
48
+ cause: Schema.optional(Schema.Unknown),
49
+ }) {
50
+ }
51
+ /**
52
+ * The fact sentence an unavailable manifest reports. The producer owns it so
53
+ * the transaction closure and the application boundary say the same thing.
54
+ */
55
+ export const authoredManifestUnavailableDetail = (failure) => {
56
+ switch (failure.reason) {
57
+ case "missing":
58
+ return `Manifest not found: ${failure.manifestPath}`;
59
+ case "unreadable":
60
+ return `Failed to read manifest: ${failure.manifestPath}`;
61
+ case "unparsable":
62
+ return `Invalid JSON in manifest: ${failure.manifestPath}`;
63
+ case "invalid":
64
+ return `Invalid version in manifest: ${failure.manifestPath}`;
65
+ }
66
+ };
67
+ /** The error category an unavailable manifest is reported under. */
68
+ export const authoredManifestUnavailableCategory = (failure) => failure.reason === "missing"
69
+ ? "not_found"
70
+ : failure.reason === "unreadable"
71
+ ? "internal"
72
+ : "validation";
73
+ //# sourceMappingURL=errors.js.map
package/package.json CHANGED
@@ -4,19 +4,29 @@
4
4
  "url": "https://github.com/agentxm/axm/issues"
5
5
  },
6
6
  "dependencies": {
7
- "@agentxm/extension-model": "^0.28.11",
8
- "@agentxm/extension-workspace": "^0.28.11",
9
- "@agentxm/registry-protocol": "^0.28.11",
10
- "@agentxm/workspace-operations": "^0.28.11",
11
- "@agentxm/workspace-state": "^0.28.11",
7
+ "@agentxm/extension-content": "^0.28.13",
8
+ "@agentxm/extension-materialization": "^0.28.13",
9
+ "@agentxm/extension-model": "^0.28.13",
10
+ "@agentxm/extension-sources": "^0.28.13",
11
+ "@agentxm/registry-auth": "^0.28.13",
12
+ "@agentxm/registry-client": "^0.28.13",
13
+ "@agentxm/workspace-operations": "^0.28.13",
14
+ "@agentxm/workspace-projection": "^0.28.13",
15
+ "@agentxm/workspace-state": "^0.28.13",
16
+ "@agentxm/workspace-transactions": "^0.28.13",
12
17
  "effect": "4.0.0-rc.112",
18
+ "semver": "^7.8.5",
13
19
  "yaml": "^2.9.0"
14
20
  },
15
21
  "description": "AXM extension-authoring feature: new-extension scaffolding, fork, native import, adopt/demote identity policy, and authored pack membership for the axm CLI. Unstable and unsupported — use the axm.sh CLI.",
16
22
  "devDependencies": {
23
+ "@agentxm/agent-integration": "^0.28.13",
24
+ "@agentxm/extension-resolution": "^0.28.13",
25
+ "@agentxm/specification-metadata": "^0.28.13",
17
26
  "@effect/platform-node": "4.0.0-rc.112",
18
27
  "@effect/vitest": "4.0.0-rc.112",
19
28
  "@types/bun": "^1.3.14",
29
+ "@types/semver": "^7.7.1",
20
30
  "@typescript/native": "npm:typescript@^7.0.2",
21
31
  "typescript": "npm:@typescript/typescript6@^6.0.2",
22
32
  "vitest": "^4.1.10"
@@ -29,6 +39,11 @@
29
39
  "axm-source": "./src/index.ts",
30
40
  "default": "./dist/src/index.js",
31
41
  "types": "./dist/src/index.d.ts"
42
+ },
43
+ "./testing": {
44
+ "axm-source": "./src/testing.ts",
45
+ "default": "./dist/src/testing.js",
46
+ "types": "./dist/src/testing.d.ts"
32
47
  }
33
48
  },
34
49
  "files": [
@@ -45,11 +60,11 @@
45
60
  "access": "public"
46
61
  },
47
62
  "repository": {
48
- "directory": "packages/extension-authoring",
63
+ "directory": "packages/core/extension-authoring",
49
64
  "type": "git",
50
65
  "url": "https://github.com/agentxm/axm.git"
51
66
  },
52
67
  "sideEffects": false,
53
68
  "type": "module",
54
- "version": "0.28.11"
55
- }
69
+ "version": "0.28.13"
70
+ }
@@ -1,19 +0,0 @@
1
- import { type ExtensionName, type ExtensionType } from "@agentxm/extension-model/unstable/extensions/common";
2
- import type { Handle } from "@agentxm/extension-model/unstable/extensions/handle";
3
- export type DesiredPackageAuthority = "registry" | "workspace";
4
- export interface DecodedDesiredExtensionIdentity {
5
- readonly authority: DesiredPackageAuthority;
6
- readonly owner: Handle;
7
- readonly type: ExtensionType;
8
- readonly name: ExtensionName;
9
- readonly fqn: string;
10
- }
11
- /**
12
- * Decode the source-qualified identity stored in the desired-state graph.
13
- *
14
- * This is deliberately narrower than source-locator parsing: desired graph
15
- * identities are either validated Registry FQNs or `workspace:` followed by a
16
- * validated FQN. Unknown authorities fail closed.
17
- */
18
- export declare const decodeDesiredExtensionIdentity: (identity: string) => DecodedDesiredExtensionIdentity | undefined;
19
- //# sourceMappingURL=desired-identity.d.ts.map
@@ -1,26 +0,0 @@
1
- import { parseExtensionFqnParts, } from "@agentxm/extension-model/unstable/extensions/common";
2
- const workspacePrefix = "workspace:";
3
- /**
4
- * Decode the source-qualified identity stored in the desired-state graph.
5
- *
6
- * This is deliberately narrower than source-locator parsing: desired graph
7
- * identities are either validated Registry FQNs or `workspace:` followed by a
8
- * validated FQN. Unknown authorities fail closed.
9
- */
10
- export const decodeDesiredExtensionIdentity = (identity) => {
11
- const authority = identity.startsWith(workspacePrefix)
12
- ? "workspace"
13
- : "registry";
14
- const fqn = authority === "workspace" ? identity.slice(workspacePrefix.length) : identity;
15
- const parsed = parseExtensionFqnParts(fqn);
16
- if (parsed === undefined)
17
- return undefined;
18
- return {
19
- authority,
20
- owner: parsed.owner,
21
- type: parsed.type,
22
- name: parsed.name,
23
- fqn,
24
- };
25
- };
26
- //# sourceMappingURL=desired-identity.js.map
@@ -1,31 +0,0 @@
1
- /**
2
- * The application-supplied conversion from authoring failures to the plan
3
- * step vocabulary. Error rendering is application-owned: the CLI implements
4
- * this with the same dispatcher it uses at its output boundary, so step
5
- * categories and details inside authoring operations stay byte-identical
6
- * with rendered errors. The feature keeps only the requirement, never the
7
- * mapping.
8
- *
9
- * @experimental This API is unstable and may change without notice.
10
- */
11
- import * as ServiceMap from "effect/Context";
12
- import * as Effect from "effect/Effect";
13
- import type { StepFailure } from "@agentxm/workspace-operations";
14
- export interface AuthoringFailureAdapterService {
15
- /**
16
- * Serialize any failure an authoring operation can surface — kernel
17
- * failures and the feature's own typed failures — into the plan-step
18
- * vocabulary.
19
- */
20
- readonly toStepFailure: (failure: unknown) => StepFailure;
21
- }
22
- declare const AuthoringFailureAdapter_base: ServiceMap.ServiceClass<AuthoringFailureAdapter, "@agentxm/extension-authoring/failure-adapter/AuthoringFailureAdapter", AuthoringFailureAdapterService>;
23
- export declare class AuthoringFailureAdapter extends AuthoringFailureAdapter_base {
24
- }
25
- /**
26
- * Serialize every failure of one authoring operation into the plan-step
27
- * vocabulary through the application-supplied adapter.
28
- */
29
- export declare const withAdaptedStepFailures: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, StepFailure, R | AuthoringFailureAdapter>;
30
- export {};
31
- //# sourceMappingURL=failure-adapter.d.ts.map
@@ -1,23 +0,0 @@
1
- /**
2
- * The application-supplied conversion from authoring failures to the plan
3
- * step vocabulary. Error rendering is application-owned: the CLI implements
4
- * this with the same dispatcher it uses at its output boundary, so step
5
- * categories and details inside authoring operations stay byte-identical
6
- * with rendered errors. The feature keeps only the requirement, never the
7
- * mapping.
8
- *
9
- * @experimental This API is unstable and may change without notice.
10
- */
11
- import * as ServiceMap from "effect/Context";
12
- import * as Effect from "effect/Effect";
13
- export class AuthoringFailureAdapter extends ServiceMap.Service()("@agentxm/extension-authoring/failure-adapter/AuthoringFailureAdapter") {
14
- }
15
- /**
16
- * Serialize every failure of one authoring operation into the plan-step
17
- * vocabulary through the application-supplied adapter.
18
- */
19
- export const withAdaptedStepFailures = (effect) => Effect.gen(function* () {
20
- const adapter = yield* AuthoringFailureAdapter;
21
- return yield* effect.pipe(Effect.mapError((failure) => adapter.toStepFailure(failure)));
22
- });
23
- //# sourceMappingURL=failure-adapter.js.map
@@ -1,46 +0,0 @@
1
- /**
2
- * New hook operation — scaffolds a new hook directory with the manifest and a
3
- * starter entrypoint.
4
- *
5
- * @experimental This API is unstable and may change without notice.
6
- */
7
- import * as FileSystem from "effect/FileSystem";
8
- import * as Path from "effect/Path";
9
- import { AuthoringFailureAdapter } from "../failure-adapter.js";
10
- import type { Handle } from "@agentxm/extension-model/unstable/extensions/handle";
11
- import type { OperationHandler } from "@agentxm/workspace-operations";
12
- import type { Operation } from "@agentxm/workspace-operations";
13
- import { WorkspaceMutations } from "@agentxm/workspace-state";
14
- import { type HookEvent, type HookRuntime } from "@agentxm/extension-model/unstable/hooks/manifest-schema";
15
- /**
16
- * Args for the new-hook operation.
17
- */
18
- export interface NewHookOperationArgs {
19
- /** Hook name (validated, lowercase with hyphens). */
20
- readonly name: string;
21
- /** Owner (e.g., "@myorg"). */
22
- readonly owner: Handle;
23
- /** Interpreter family for the entrypoint. */
24
- readonly runtime: HookRuntime;
25
- /** Canonical hook event the scaffold binds to. */
26
- readonly event: HookEvent;
27
- /** Optional raw matcher (only meaningful for tool.pre/tool.post). */
28
- readonly matcher: string | undefined;
29
- }
30
- /**
31
- * Scaffold a new hook in the workspace.
32
- *
33
- * @experimental This API is unstable and may change without notice.
34
- */
35
- export type NewHookOperation = Operation<"new-hook", NewHookOperationArgs>;
36
- /**
37
- * New-hook operation handler.
38
- *
39
- * 1. Compute managed extension directory path
40
- * 2. Check if the hook already exists (directory or settings entry)
41
- * 3. Create the managed extension + src directories
42
- * 4. Write hook.json manifest
43
- * 5. Write starter entrypoint in src/
44
- */
45
- export declare const newHook: OperationHandler<NewHookOperation, FileSystem.FileSystem | Path.Path | WorkspaceMutations | AuthoringFailureAdapter>;
46
- //# sourceMappingURL=new-hook.d.ts.map