@agentxm/extension-content 0.34.0 → 0.36.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.
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +2 -1
- package/dist/src/lint/catalog/pack/manifest-present.d.ts +1 -1
- package/dist/src/lint/catalog/pack-accessor/platform.d.ts +3 -3
- package/dist/src/lint/catalog/pack-accessor/platform.js +3 -3
- package/dist/src/lint/catalog/shared/recommended-packs-rules.d.ts +0 -12
- package/dist/src/lint/catalog/shared/recommended-packs-rules.js +2 -17
- package/dist/src/lint/catalog/skill/manifest-present.d.ts +1 -1
- package/dist/src/lint/catalog/skill-accessor/platform.d.ts +1 -1
- package/dist/src/lint/catalog/skill-accessor/platform.js +1 -1
- package/dist/src/lint/catalog-metadata.js +6 -0
- package/dist/src/lint/describe-document.js +1 -2
- package/dist/src/lint/evaluate.d.ts +3 -3
- package/dist/src/lint/rule.d.ts +3 -3
- package/dist/src/packaging/manifest-file.d.ts +20 -0
- package/dist/src/packaging/manifest-file.js +60 -0
- package/dist/src/packaging/manifest-policy.d.ts +4 -1
- package/dist/src/packaging/manifest-policy.js +3 -1
- package/package.json +3 -3
package/dist/src/index.d.ts
CHANGED
|
@@ -19,5 +19,6 @@ export { ArchiveGuardrailError, type ArchiveGuardrailLimits, ZIP_LOCAL_SIGNATURE
|
|
|
19
19
|
export { FilteredPackageError, type ValidateFilteredPackageArgs, validateFilteredPackage, } from "./packaging/filtered-package-validation.js";
|
|
20
20
|
export { IngestLimitError, IngestUnsupportedContentTypeError, REGISTRY_PUBLISH_MAX_ARCHIVE_BYTES, REGISTRY_PUBLISH_MAX_REQUEST_BYTES, enforceArchiveContentType, enforceArchiveSizeLimit, enforceRequestSizeLimit, } from "./packaging/ingest-limits.js";
|
|
21
21
|
export { type NormalizePublishInputArgs, type PublishArchiveInput, type PublishInput, defaultReadEntry, normalizePublishInput, } from "./packaging/input-normalization.js";
|
|
22
|
-
export { type DeclaredPublishIdentity, type ExtensionManifest, MANIFEST_FILENAME_BY_TYPE, MANIFEST_SCHEMA_BY_TYPE, ManifestError, type ManifestIdentity, ManifestIdentitySchema, type ManifestResolutionInput, type ResolvedManifest, manifestFilenameForType, manifestSchemaForType, resolveManifest, validateDeclaredManifestAlignment, validateManifestHasNoAgentsField, } from "./packaging/manifest-policy.js";
|
|
22
|
+
export { type DeclaredPublishIdentity, type ExtensionManifest, MANIFEST_FILENAME_BY_TYPE, MANIFEST_FILENAMES, MANIFEST_SCHEMA_BY_TYPE, ManifestError, type ManifestIdentity, ManifestIdentitySchema, type ManifestResolutionInput, type ResolvedManifest, manifestFilenameForType, extensionTypeForManifestFilename, manifestSchemaForType, resolveManifest, validateDeclaredManifestAlignment, validateManifestHasNoAgentsField, } from "./packaging/manifest-policy.js";
|
|
23
|
+
export { readExtensionManifest } from "./packaging/manifest-file.js";
|
|
23
24
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.js
CHANGED
|
@@ -19,5 +19,6 @@ export { ArchiveGuardrailError, ZIP_LOCAL_SIGNATURE, checkForbiddenSourceEntries
|
|
|
19
19
|
export { FilteredPackageError, validateFilteredPackage, } from "./packaging/filtered-package-validation.js";
|
|
20
20
|
export { IngestLimitError, IngestUnsupportedContentTypeError, REGISTRY_PUBLISH_MAX_ARCHIVE_BYTES, REGISTRY_PUBLISH_MAX_REQUEST_BYTES, enforceArchiveContentType, enforceArchiveSizeLimit, enforceRequestSizeLimit, } from "./packaging/ingest-limits.js";
|
|
21
21
|
export { defaultReadEntry, normalizePublishInput, } from "./packaging/input-normalization.js";
|
|
22
|
-
export { MANIFEST_FILENAME_BY_TYPE, MANIFEST_SCHEMA_BY_TYPE, ManifestError, ManifestIdentitySchema, manifestFilenameForType, manifestSchemaForType, resolveManifest, validateDeclaredManifestAlignment, validateManifestHasNoAgentsField, } from "./packaging/manifest-policy.js";
|
|
22
|
+
export { MANIFEST_FILENAME_BY_TYPE, MANIFEST_FILENAMES, MANIFEST_SCHEMA_BY_TYPE, ManifestError, ManifestIdentitySchema, manifestFilenameForType, extensionTypeForManifestFilename, manifestSchemaForType, resolveManifest, validateDeclaredManifestAlignment, validateManifestHasNoAgentsField, } from "./packaging/manifest-policy.js";
|
|
23
|
+
export { readExtensionManifest } from "./packaging/manifest-file.js";
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
* @packageDocumentation
|
|
14
14
|
*/
|
|
15
15
|
import type { PackRuleContext } from "../../context.js";
|
|
16
|
-
export declare const manifestPresentRule: import("../../rule.ts").AdvisoryRule<PackRuleContext<import("../../context.js").PackContent
|
|
16
|
+
export declare const manifestPresentRule: import("../../rule.ts").AdvisoryRule<PackRuleContext<import("../../context.js").PackContent>, never>;
|
|
17
17
|
//# sourceMappingURL=manifest-present.d.ts.map
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
*
|
|
11
11
|
* Packs are registry-only at v1 — there is no non-native variant. The caller
|
|
12
12
|
* (`buildPackRuleContexts` or the CLI entry point) picks the root from
|
|
13
|
-
* `computePackPathsForLayout` in `@agentxm/workspace/
|
|
13
|
+
* `computePackPathsForLayout` in `@agentxm/workspace-kernel/workspace-state`.
|
|
14
14
|
*
|
|
15
15
|
* The `pack.json` sits directly under `canonicalPath`; there is no
|
|
16
16
|
* `src/` subdirectory like skills have — the pack install operation in
|
|
17
|
-
* `@agentxm/
|
|
17
|
+
* `@agentxm/extension-kinds/packs` owns the authoritative layout.
|
|
18
18
|
*
|
|
19
19
|
* Bounds enforcement:
|
|
20
20
|
*
|
|
@@ -48,7 +48,7 @@ export interface PackAccessorPlatform {
|
|
|
48
48
|
*
|
|
49
49
|
* `absoluteRoot` SHOULD be the absolute path to the pack root directory
|
|
50
50
|
* (`canonicalPath` from `computePackPathsForLayout` in
|
|
51
|
-
* `@agentxm/workspace/
|
|
51
|
+
* `@agentxm/workspace-kernel/workspace-state`).
|
|
52
52
|
*
|
|
53
53
|
* @experimental This API is unstable and may change without notice.
|
|
54
54
|
*/
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
*
|
|
11
11
|
* Packs are registry-only at v1 — there is no non-native variant. The caller
|
|
12
12
|
* (`buildPackRuleContexts` or the CLI entry point) picks the root from
|
|
13
|
-
* `computePackPathsForLayout` in `@agentxm/workspace/
|
|
13
|
+
* `computePackPathsForLayout` in `@agentxm/workspace-kernel/workspace-state`.
|
|
14
14
|
*
|
|
15
15
|
* The `pack.json` sits directly under `canonicalPath`; there is no
|
|
16
16
|
* `src/` subdirectory like skills have — the pack install operation in
|
|
17
|
-
* `@agentxm/
|
|
17
|
+
* `@agentxm/extension-kinds/packs` owns the authoritative layout.
|
|
18
18
|
*
|
|
19
19
|
* Bounds enforcement:
|
|
20
20
|
*
|
|
@@ -39,7 +39,7 @@ import * as Effect from "effect/Effect";
|
|
|
39
39
|
*
|
|
40
40
|
* `absoluteRoot` SHOULD be the absolute path to the pack root directory
|
|
41
41
|
* (`canonicalPath` from `computePackPathsForLayout` in
|
|
42
|
-
* `@agentxm/workspace/
|
|
42
|
+
* `@agentxm/workspace-kernel/workspace-state`).
|
|
43
43
|
*
|
|
44
44
|
* @experimental This API is unstable and may change without notice.
|
|
45
45
|
*/
|
|
@@ -30,18 +30,6 @@ export interface RecommendedPacksRuleOptions<C> {
|
|
|
30
30
|
/** Reads the caller-decoded manifest JSON off the rule context. */
|
|
31
31
|
readonly manifestJson: (context: C) => unknown;
|
|
32
32
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Split a `recommendedPacks` entry into its FQN and optional version range.
|
|
35
|
-
*
|
|
36
|
-
* Mirrors the separator search in `PackSpecSchema`: the range delimiter is the
|
|
37
|
-
* first `@` after the last `/`, since the owner segment also starts with `@`.
|
|
38
|
-
*
|
|
39
|
-
* @experimental This API is unstable and may change without notice.
|
|
40
|
-
*/
|
|
41
|
-
export declare const splitPackSpec: (spec: string) => {
|
|
42
|
-
readonly fqn: string;
|
|
43
|
-
readonly range: string | undefined;
|
|
44
|
-
};
|
|
45
33
|
/**
|
|
46
34
|
* Build the `<namespace>/standalone-declaration-valid` rule for one catalog.
|
|
47
35
|
*
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* @packageDocumentation
|
|
18
18
|
*/
|
|
19
19
|
import * as Effect from "effect/Effect";
|
|
20
|
+
import { splitExtensionReference } from "@agentxm/extension-model/unstable/extensions/common";
|
|
20
21
|
import { isManifestJsonParseFailure } from "./manifest-json.js";
|
|
21
22
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22
23
|
/**
|
|
@@ -31,22 +32,6 @@ const manifestRecord = (input) => {
|
|
|
31
32
|
return input;
|
|
32
33
|
};
|
|
33
34
|
const stringEntries = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
|
|
34
|
-
/**
|
|
35
|
-
* Split a `recommendedPacks` entry into its FQN and optional version range.
|
|
36
|
-
*
|
|
37
|
-
* Mirrors the separator search in `PackSpecSchema`: the range delimiter is the
|
|
38
|
-
* first `@` after the last `/`, since the owner segment also starts with `@`.
|
|
39
|
-
*
|
|
40
|
-
* @experimental This API is unstable and may change without notice.
|
|
41
|
-
*/
|
|
42
|
-
export const splitPackSpec = (spec) => {
|
|
43
|
-
const lastSlash = spec.lastIndexOf("/");
|
|
44
|
-
const rangeAt = lastSlash > 0 ? spec.indexOf("@", lastSlash + 1) : -1;
|
|
45
|
-
if (rangeAt <= 0) {
|
|
46
|
-
return { fqn: spec, range: undefined };
|
|
47
|
-
}
|
|
48
|
-
return { fqn: spec.slice(0, rangeAt), range: spec.slice(rangeAt + 1) };
|
|
49
|
-
};
|
|
50
35
|
// -----------------------------------------------------------------------------
|
|
51
36
|
// <namespace>/standalone-declaration-valid
|
|
52
37
|
// -----------------------------------------------------------------------------
|
|
@@ -119,7 +104,7 @@ export const makeRecommendedPacksValidRule = (options) => {
|
|
|
119
104
|
}
|
|
120
105
|
const findings = [];
|
|
121
106
|
for (const entry of stringEntries(manifest["recommendedPacks"])) {
|
|
122
|
-
const { fqn, range } =
|
|
107
|
+
const { name: fqn, constraint: range } = splitExtensionReference(entry);
|
|
123
108
|
if (range === undefined) {
|
|
124
109
|
continue;
|
|
125
110
|
}
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
*/
|
|
21
21
|
import type { SkillRuleContext } from "../../context.js";
|
|
22
|
-
export declare const manifestPresentRule: import("../../rule.ts").AdvisoryRule<SkillRuleContext<import("../../context.js").SkillContent
|
|
22
|
+
export declare const manifestPresentRule: import("../../rule.ts").AdvisoryRule<SkillRuleContext<import("../../context.js").SkillContent>, never>;
|
|
23
23
|
//# sourceMappingURL=manifest-present.d.ts.map
|
|
@@ -45,7 +45,7 @@ export interface SkillAccessorPlatform {
|
|
|
45
45
|
* `absoluteRoot` SHOULD be the absolute path to the skill root directory
|
|
46
46
|
* (either `.../src/` for native, or the selected package directory for a
|
|
47
47
|
* portable Agent Skill). The caller typically sources it from
|
|
48
|
-
* `computeSkillPathsForLayout` in `@agentxm/workspace/
|
|
48
|
+
* `computeSkillPathsForLayout` in `@agentxm/workspace-kernel/workspace-state`.
|
|
49
49
|
*
|
|
50
50
|
* @experimental This API is unstable and may change without notice.
|
|
51
51
|
*/
|
|
@@ -36,7 +36,7 @@ import * as Effect from "effect/Effect";
|
|
|
36
36
|
* `absoluteRoot` SHOULD be the absolute path to the skill root directory
|
|
37
37
|
* (either `.../src/` for native, or the selected package directory for a
|
|
38
38
|
* portable Agent Skill). The caller typically sources it from
|
|
39
|
-
* `computeSkillPathsForLayout` in `@agentxm/workspace/
|
|
39
|
+
* `computeSkillPathsForLayout` in `@agentxm/workspace-kernel/workspace-state`.
|
|
40
40
|
*
|
|
41
41
|
* @experimental This API is unstable and may change without notice.
|
|
42
42
|
*/
|
|
@@ -570,6 +570,12 @@ export const lintCatalogRuleMetadata = defineLintCatalog([
|
|
|
570
570
|
group: "workspace",
|
|
571
571
|
views: workspaceView,
|
|
572
572
|
},
|
|
573
|
+
{
|
|
574
|
+
id: "workspace/deprecated-installed",
|
|
575
|
+
defaultSeverity: "warning",
|
|
576
|
+
group: "workspace",
|
|
577
|
+
views: workspaceView,
|
|
578
|
+
},
|
|
573
579
|
{
|
|
574
580
|
id: "workspace/authored-package-declared",
|
|
575
581
|
defaultSeverity: "warning",
|
|
@@ -17,9 +17,8 @@
|
|
|
17
17
|
* @packageDocumentation
|
|
18
18
|
*/
|
|
19
19
|
import { extensionTypeSentenceLabels, extensionTypes, } from "@agentxm/extension-model/unstable/extensions/common";
|
|
20
|
-
import { LOCKFILE_NAME } from "@agentxm/extension-model/unstable/workspace-files";
|
|
20
|
+
import { LOCKFILE_NAME, SETTINGS_FILENAME, } from "@agentxm/extension-model/unstable/workspace-files";
|
|
21
21
|
import { MANIFEST_FILENAME_BY_TYPE } from "../packaging/manifest-policy.js";
|
|
22
|
-
import { SETTINGS_FILENAME } from "@agentxm/extension-model/unstable/workspace-files";
|
|
23
22
|
/** Label used when a filename matches no known document. */
|
|
24
23
|
export const UNKNOWN_DOCUMENT_LABEL = "Document";
|
|
25
24
|
const capitalizeFirst = (value) => value.length === 0 ? value : `${value.charAt(0).toUpperCase()}${value.slice(1)}`;
|
|
@@ -24,8 +24,8 @@ import type { LintFinding, LintRule } from "./rule.js";
|
|
|
24
24
|
*
|
|
25
25
|
* @experimental This API is unstable and may change without notice.
|
|
26
26
|
*/
|
|
27
|
-
export interface Evaluated<C> {
|
|
28
|
-
readonly rule: LintRule<C>;
|
|
27
|
+
export interface Evaluated<C, E = never> {
|
|
28
|
+
readonly rule: LintRule<C, E>;
|
|
29
29
|
readonly context: C;
|
|
30
30
|
readonly findings: ReadonlyArray<LintFinding>;
|
|
31
31
|
}
|
|
@@ -43,5 +43,5 @@ export interface Evaluated<C> {
|
|
|
43
43
|
*
|
|
44
44
|
* @experimental This API is unstable and may change without notice.
|
|
45
45
|
*/
|
|
46
|
-
export declare const evaluateContexts: <C>(rules: ReadonlyArray<LintRule<C>>, contexts: ReadonlyArray<C>, config: LintConfig) => Effect.Effect<ReadonlyArray<Evaluated<C
|
|
46
|
+
export declare const evaluateContexts: <C, E>(rules: ReadonlyArray<LintRule<C, E>>, contexts: ReadonlyArray<C>, config: LintConfig) => Effect.Effect<ReadonlyArray<Evaluated<C, E>>, E>;
|
|
47
47
|
//# sourceMappingURL=evaluate.d.ts.map
|
package/dist/src/lint/rule.d.ts
CHANGED
|
@@ -84,14 +84,14 @@ export interface RuleBase {
|
|
|
84
84
|
*
|
|
85
85
|
* @experimental This API is unstable and may change without notice.
|
|
86
86
|
*/
|
|
87
|
-
export interface AdvisoryRule<C> extends RuleBase {
|
|
87
|
+
export interface AdvisoryRule<C, E = never> extends RuleBase {
|
|
88
88
|
readonly kind: "advisory";
|
|
89
|
-
readonly check: (context: C) => Effect.Effect<ReadonlyArray<AdvisoryFinding
|
|
89
|
+
readonly check: (context: C) => Effect.Effect<ReadonlyArray<AdvisoryFinding>, E>;
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
92
92
|
* Discriminated union of lint rules over a caller-built rule-context type `C`.
|
|
93
93
|
*
|
|
94
94
|
* @experimental This API is unstable and may change without notice.
|
|
95
95
|
*/
|
|
96
|
-
export type LintRule<C> = AdvisoryRule<C>;
|
|
96
|
+
export type LintRule<C, E = never> = AdvisoryRule<C, E>;
|
|
97
97
|
//# sourceMappingURL=rule.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Read and validate a package manifest from its owning directory. */
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as FileSystem from "effect/FileSystem";
|
|
4
|
+
import * as Path from "effect/Path";
|
|
5
|
+
import type { ExtensionType } from "@agentxm/extension-model/unstable/extensions/common";
|
|
6
|
+
import type { Handle } from "@agentxm/extension-model/unstable/extensions/handle";
|
|
7
|
+
import { ManifestError, type ExtensionManifest, type ManifestIdentity } from "./manifest-policy.js";
|
|
8
|
+
interface ReadManifestOptions {
|
|
9
|
+
readonly defaultOwner?: Handle;
|
|
10
|
+
}
|
|
11
|
+
interface ReadManifestResult {
|
|
12
|
+
readonly path: string;
|
|
13
|
+
readonly fileName: string;
|
|
14
|
+
readonly raw: unknown;
|
|
15
|
+
readonly manifest: ExtensionManifest;
|
|
16
|
+
readonly identity: ManifestIdentity;
|
|
17
|
+
}
|
|
18
|
+
export declare const readExtensionManifest: (directory: string, type: ExtensionType, options?: ReadManifestOptions) => Effect.Effect<ReadManifestResult, ManifestError, FileSystem.FileSystem | Path.Path>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=manifest-file.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Read and validate a package manifest from its owning directory. */
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as FileSystem from "effect/FileSystem";
|
|
4
|
+
import * as Path from "effect/Path";
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
6
|
+
import * as SchemaIssue from "effect/SchemaIssue";
|
|
7
|
+
import { ManifestError, ManifestIdentitySchema, manifestFilenameForType, manifestSchemaForType, } from "./manifest-policy.js";
|
|
8
|
+
const withDefaultOwner = (raw, defaultOwner) => defaultOwner !== undefined &&
|
|
9
|
+
typeof raw === "object" &&
|
|
10
|
+
raw !== null &&
|
|
11
|
+
!Array.isArray(raw) &&
|
|
12
|
+
!Object.hasOwn(raw, "owner")
|
|
13
|
+
? { ...raw, owner: defaultOwner }
|
|
14
|
+
: raw;
|
|
15
|
+
export const readExtensionManifest = (directory, type, options) => Effect.gen(function* () {
|
|
16
|
+
const fs = yield* FileSystem.FileSystem;
|
|
17
|
+
const path = yield* Path.Path;
|
|
18
|
+
const fileName = manifestFilenameForType(type);
|
|
19
|
+
const manifestPath = path.join(directory, fileName);
|
|
20
|
+
const exists = yield* fs.exists(manifestPath).pipe(Effect.mapError((cause) => new ManifestError({
|
|
21
|
+
code: "manifest_unreadable",
|
|
22
|
+
detail: `Manifest file "${manifestPath}" could not be inspected.`,
|
|
23
|
+
cause,
|
|
24
|
+
})));
|
|
25
|
+
if (!exists) {
|
|
26
|
+
return yield* new ManifestError({
|
|
27
|
+
code: "manifest_missing",
|
|
28
|
+
detail: `Expected manifest file "${fileName}" not found in ${directory}.`,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const content = yield* fs.readFileString(manifestPath).pipe(Effect.mapError((cause) => new ManifestError({
|
|
32
|
+
code: "manifest_unreadable",
|
|
33
|
+
detail: `Manifest file "${manifestPath}" could not be read.`,
|
|
34
|
+
cause,
|
|
35
|
+
})));
|
|
36
|
+
const parsed = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(Schema.Unknown))(content).pipe(Effect.mapError((cause) => new ManifestError({
|
|
37
|
+
code: "manifest_invalid_json",
|
|
38
|
+
detail: `Manifest file "${fileName}" contains invalid JSON.`,
|
|
39
|
+
cause,
|
|
40
|
+
})));
|
|
41
|
+
const raw = withDefaultOwner(parsed, options?.defaultOwner);
|
|
42
|
+
const manifest = yield* Schema.decodeUnknownEffect(manifestSchemaForType(type))(raw).pipe(Effect.mapError((cause) => new ManifestError({
|
|
43
|
+
code: "manifest_schema_invalid",
|
|
44
|
+
detail: `Manifest file "${fileName}" does not conform to the ${type} manifest schema.`,
|
|
45
|
+
details: SchemaIssue.makeFormatterDefault()(cause.issue),
|
|
46
|
+
})));
|
|
47
|
+
const identity = yield* Schema.decodeUnknownEffect(ManifestIdentitySchema)(manifest).pipe(Effect.mapError((cause) => new ManifestError({
|
|
48
|
+
code: "manifest_schema_invalid",
|
|
49
|
+
detail: `Manifest file "${fileName}" is missing required identity fields.`,
|
|
50
|
+
details: SchemaIssue.makeFormatterDefault()(cause.issue),
|
|
51
|
+
})));
|
|
52
|
+
if (identity.type !== type) {
|
|
53
|
+
return yield* new ManifestError({
|
|
54
|
+
code: "manifest_schema_invalid",
|
|
55
|
+
detail: `Manifest declared type "${identity.type}" disagrees with ${fileName}.`,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return { path: manifestPath, fileName, raw, manifest, identity };
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=manifest-file.js.map
|
|
@@ -9,9 +9,10 @@ declare const ManifestError_base: new <A extends Record<string, any> = {}>(args:
|
|
|
9
9
|
readonly _tag: "ManifestError";
|
|
10
10
|
} & Readonly<A>;
|
|
11
11
|
export declare class ManifestError extends ManifestError_base<{
|
|
12
|
-
readonly code: "manifest_missing" | "manifest_multiple" | "manifest_invalid_json" | "manifest_schema_invalid" | "companion_package_purl_has_version" | "companion_package_scheme_mismatch" | "companion_package_invalid" | "declared_manifest_mismatch";
|
|
12
|
+
readonly code: "manifest_missing" | "manifest_unreadable" | "manifest_multiple" | "manifest_invalid_json" | "manifest_schema_invalid" | "companion_package_purl_has_version" | "companion_package_scheme_mismatch" | "companion_package_invalid" | "declared_manifest_mismatch";
|
|
13
13
|
readonly detail: string;
|
|
14
14
|
readonly details?: unknown;
|
|
15
|
+
readonly cause?: unknown;
|
|
15
16
|
}> {
|
|
16
17
|
}
|
|
17
18
|
export declare const MANIFEST_FILENAME_BY_TYPE: {
|
|
@@ -23,6 +24,8 @@ export declare const MANIFEST_FILENAME_BY_TYPE: {
|
|
|
23
24
|
readonly hook: "hook.json";
|
|
24
25
|
readonly knowledge: "knowledge.json";
|
|
25
26
|
};
|
|
27
|
+
export declare const MANIFEST_FILENAMES: ReadonlySet<string>;
|
|
28
|
+
export declare const extensionTypeForManifestFilename: (fileName: string) => ExtensionType | undefined;
|
|
26
29
|
export declare const manifestFilenameForType: (type: ExtensionType) => string;
|
|
27
30
|
export declare const ManifestIdentitySchema: Schema.Struct<{
|
|
28
31
|
readonly owner: Schema.brand<Schema.String, "Handle">;
|
|
@@ -3,7 +3,7 @@ import * as Effect from "effect/Effect";
|
|
|
3
3
|
import * as Result from "effect/Result";
|
|
4
4
|
import * as Schema from "effect/Schema";
|
|
5
5
|
import * as SchemaIssue from "effect/SchemaIssue";
|
|
6
|
-
import { ExtensionNameSchema, ExtensionTypeSchema, } from "@agentxm/extension-model/unstable/extensions/common";
|
|
6
|
+
import { ExtensionNameSchema, ExtensionTypeSchema, extensionTypes, } from "@agentxm/extension-model/unstable/extensions/common";
|
|
7
7
|
import { HookManifestSchema, HOOK_MANIFEST_FILENAME, } from "@agentxm/extension-model/unstable/hooks/manifest-schema";
|
|
8
8
|
import { HandleSchema } from "@agentxm/extension-model/unstable/extensions/handle";
|
|
9
9
|
import { KnowledgeManifestSchema, KNOWLEDGE_MANIFEST_FILENAME, } from "@agentxm/extension-model/unstable/knowledge/manifest-schema";
|
|
@@ -24,6 +24,8 @@ export const MANIFEST_FILENAME_BY_TYPE = {
|
|
|
24
24
|
hook: HOOK_MANIFEST_FILENAME,
|
|
25
25
|
knowledge: KNOWLEDGE_MANIFEST_FILENAME,
|
|
26
26
|
};
|
|
27
|
+
export const MANIFEST_FILENAMES = new Set(Object.values(MANIFEST_FILENAME_BY_TYPE));
|
|
28
|
+
export const extensionTypeForManifestFilename = (fileName) => extensionTypes.find((type) => MANIFEST_FILENAME_BY_TYPE[type] === fileName);
|
|
27
29
|
export const manifestFilenameForType = (type) => MANIFEST_FILENAME_BY_TYPE[type];
|
|
28
30
|
export const ManifestIdentitySchema = Schema.Struct({
|
|
29
31
|
owner: HandleSchema.pipe(Schema.annotateKey({ messageMissingKey: "owner is required" })),
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"url": "https://github.com/agentxm/axm/issues"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@agentxm/extension-model": "^0.
|
|
7
|
+
"@agentxm/extension-model": "^0.36.0",
|
|
8
8
|
"effect": "4.0.0-rc.117",
|
|
9
9
|
"yaml": "^2.9.0"
|
|
10
10
|
},
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@fast-check/vitest": "^0.5.0",
|
|
16
16
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
17
17
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
18
|
-
"vitest": "^5.0.
|
|
18
|
+
"vitest": "^5.0.1"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=24.19.0"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
},
|
|
59
59
|
"sideEffects": false,
|
|
60
60
|
"type": "module",
|
|
61
|
-
"version": "0.
|
|
61
|
+
"version": "0.36.0"
|
|
62
62
|
}
|