@agentxm/extension-model 0.30.1 → 0.31.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.
@@ -3207,7 +3207,7 @@ export declare const CONFIGURABLE_AGENTS_BY_ID: {
3207
3207
  };
3208
3208
  readonly axm: {
3209
3209
  readonly status: "supported";
3210
- readonly lastVerified: "2026-08-05";
3210
+ readonly lastVerified: "2026-09-12";
3211
3211
  readonly writer: {
3212
3212
  readonly config: {
3213
3213
  readonly serversKey: "mcp_servers";
@@ -3241,6 +3241,7 @@ export declare const CONFIGURABLE_AGENTS_BY_ID: {
3241
3241
  };
3242
3242
  readonly command: "split";
3243
3243
  readonly envKey: "env";
3244
+ readonly envVarsKey: "env_vars";
3244
3245
  };
3245
3246
  readonly remote: {
3246
3247
  readonly typeField: {
@@ -7040,19 +7041,19 @@ export declare const CONFIGURABLE_AGENTS_BY_ID: {
7040
7041
  };
7041
7042
  readonly notes: null;
7042
7043
  readonly docs: readonly [];
7043
- readonly sources: readonly ["https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-config-dir-reference", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference"];
7044
+ readonly sources: readonly ["https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-config-dir-reference", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference", "https://github.com/github/copilot-cli/issues/1232#issuecomment-4198097885"];
7044
7045
  readonly scopes: readonly ["user", "project"];
7045
7046
  readonly standardsCompliance: "full";
7046
7047
  readonly convention: "vendor";
7047
7048
  readonly transports: readonly ["stdio", "http", "sse"];
7048
7049
  readonly mcpEnvExpansion: {
7049
- readonly variables: "none";
7050
+ readonly variables: "braced";
7050
7051
  readonly defaults: false;
7051
7052
  };
7052
7053
  };
7053
7054
  readonly axm: {
7054
7055
  readonly status: "supported";
7055
- readonly lastVerified: "2026-08-05";
7056
+ readonly lastVerified: "2026-09-12";
7056
7057
  readonly writer: {
7057
7058
  readonly config: {
7058
7059
  readonly serversKey: "mcpServers";
@@ -19537,7 +19538,7 @@ export declare const AGENTS_BY_ID: {
19537
19538
  };
19538
19539
  readonly axm: {
19539
19540
  readonly status: "supported";
19540
- readonly lastVerified: "2026-08-05";
19541
+ readonly lastVerified: "2026-09-12";
19541
19542
  readonly writer: {
19542
19543
  readonly config: {
19543
19544
  readonly serversKey: "mcp_servers";
@@ -19571,6 +19572,7 @@ export declare const AGENTS_BY_ID: {
19571
19572
  };
19572
19573
  readonly command: "split";
19573
19574
  readonly envKey: "env";
19575
+ readonly envVarsKey: "env_vars";
19574
19576
  };
19575
19577
  readonly remote: {
19576
19578
  readonly typeField: {
@@ -23370,19 +23372,19 @@ export declare const AGENTS_BY_ID: {
23370
23372
  };
23371
23373
  readonly notes: null;
23372
23374
  readonly docs: readonly [];
23373
- readonly sources: readonly ["https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-config-dir-reference", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference"];
23375
+ readonly sources: readonly ["https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-config-dir-reference", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference", "https://github.com/github/copilot-cli/issues/1232#issuecomment-4198097885"];
23374
23376
  readonly scopes: readonly ["user", "project"];
23375
23377
  readonly standardsCompliance: "full";
23376
23378
  readonly convention: "vendor";
23377
23379
  readonly transports: readonly ["stdio", "http", "sse"];
23378
23380
  readonly mcpEnvExpansion: {
23379
- readonly variables: "none";
23381
+ readonly variables: "braced";
23380
23382
  readonly defaults: false;
23381
23383
  };
23382
23384
  };
23383
23385
  readonly axm: {
23384
23386
  readonly status: "supported";
23385
- readonly lastVerified: "2026-08-05";
23387
+ readonly lastVerified: "2026-09-12";
23386
23388
  readonly writer: {
23387
23389
  readonly config: {
23388
23390
  readonly serversKey: "mcpServers";
@@ -34867,7 +34869,7 @@ export declare const AGENTS: ({
34867
34869
  };
34868
34870
  readonly axm: {
34869
34871
  readonly status: "supported";
34870
- readonly lastVerified: "2026-08-05";
34872
+ readonly lastVerified: "2026-09-12";
34871
34873
  readonly writer: {
34872
34874
  readonly config: {
34873
34875
  readonly serversKey: "mcp_servers";
@@ -34901,6 +34903,7 @@ export declare const AGENTS: ({
34901
34903
  };
34902
34904
  readonly command: "split";
34903
34905
  readonly envKey: "env";
34906
+ readonly envVarsKey: "env_vars";
34904
34907
  };
34905
34908
  readonly remote: {
34906
34909
  readonly typeField: {
@@ -39021,19 +39024,19 @@ export declare const AGENTS: ({
39021
39024
  };
39022
39025
  readonly notes: null;
39023
39026
  readonly docs: readonly [];
39024
- readonly sources: readonly ["https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-config-dir-reference", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference"];
39027
+ readonly sources: readonly ["https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-config-dir-reference", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference", "https://github.com/github/copilot-cli/issues/1232#issuecomment-4198097885"];
39025
39028
  readonly scopes: readonly ["user", "project"];
39026
39029
  readonly standardsCompliance: "full";
39027
39030
  readonly convention: "vendor";
39028
39031
  readonly transports: readonly ["stdio", "http", "sse"];
39029
39032
  readonly mcpEnvExpansion: {
39030
- readonly variables: "none";
39033
+ readonly variables: "braced";
39031
39034
  readonly defaults: false;
39032
39035
  };
39033
39036
  };
39034
39037
  readonly axm: {
39035
39038
  readonly status: "supported";
39036
- readonly lastVerified: "2026-08-05";
39039
+ readonly lastVerified: "2026-09-12";
39037
39040
  readonly writer: {
39038
39041
  readonly config: {
39039
39042
  readonly serversKey: "mcpServers";
@@ -95,7 +95,7 @@ export declare const codexAgent: {
95
95
  };
96
96
  readonly axm: {
97
97
  readonly status: "supported";
98
- readonly lastVerified: "2026-08-05";
98
+ readonly lastVerified: "2026-09-12";
99
99
  readonly writer: {
100
100
  readonly config: {
101
101
  readonly serversKey: "mcp_servers";
@@ -129,6 +129,7 @@ export declare const codexAgent: {
129
129
  };
130
130
  readonly command: "split";
131
131
  readonly envKey: "env";
132
+ readonly envVarsKey: "env_vars";
132
133
  };
133
134
  readonly remote: {
134
135
  readonly typeField: {
@@ -80,7 +80,7 @@ export const codexAgent = {
80
80
  },
81
81
  axm: {
82
82
  status: "supported",
83
- lastVerified: "2026-08-05",
83
+ lastVerified: "2026-09-12",
84
84
  writer: {
85
85
  config: {
86
86
  serversKey: "mcp_servers",
@@ -106,6 +106,7 @@ export const codexAgent = {
106
106
  typeField: { required: null, accepted: [null] },
107
107
  command: "split",
108
108
  envKey: "env",
109
+ envVarsKey: "env_vars",
109
110
  },
110
111
  remote: {
111
112
  typeField: { required: null, accepted: [null] },
@@ -76,19 +76,19 @@ export declare const githubCopilotCliAgent: {
76
76
  };
77
77
  readonly notes: null;
78
78
  readonly docs: readonly [];
79
- readonly sources: readonly ["https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-config-dir-reference", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference"];
79
+ readonly sources: readonly ["https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-config-dir-reference", "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference", "https://github.com/github/copilot-cli/issues/1232#issuecomment-4198097885"];
80
80
  readonly scopes: readonly ["user", "project"];
81
81
  readonly standardsCompliance: "full";
82
82
  readonly convention: "vendor";
83
83
  readonly transports: readonly ["stdio", "http", "sse"];
84
84
  readonly mcpEnvExpansion: {
85
- readonly variables: "none";
85
+ readonly variables: "braced";
86
86
  readonly defaults: false;
87
87
  };
88
88
  };
89
89
  readonly axm: {
90
90
  readonly status: "supported";
91
- readonly lastVerified: "2026-08-05";
91
+ readonly lastVerified: "2026-09-12";
92
92
  readonly writer: {
93
93
  readonly config: {
94
94
  readonly serversKey: "mcpServers";
@@ -67,19 +67,20 @@ export const githubCopilotCliAgent = {
67
67
  "https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers",
68
68
  "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-config-dir-reference",
69
69
  "https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference",
70
+ "https://github.com/github/copilot-cli/issues/1232#issuecomment-4198097885",
70
71
  ],
71
72
  scopes: ["user", "project"],
72
73
  standardsCompliance: "full",
73
74
  convention: "vendor",
74
75
  transports: ["stdio", "http", "sse"],
75
76
  mcpEnvExpansion: {
76
- variables: "none",
77
+ variables: "braced",
77
78
  defaults: false,
78
79
  },
79
80
  },
80
81
  axm: {
81
82
  status: "supported",
82
- lastVerified: "2026-08-05",
83
+ lastVerified: "2026-09-12",
83
84
  writer: {
84
85
  config: {
85
86
  serversKey: "mcpServers",
@@ -1012,6 +1012,8 @@ export declare const McpStdioDialectSchema: Schema.Struct<{
1012
1012
  }>;
1013
1013
  readonly command: Schema.Literals<readonly ["split", "array"]>;
1014
1014
  readonly envKey: Schema.NullOr<Schema.NonEmptyString>;
1015
+ /** Native allowlist for forwarding same-name environment variables. */
1016
+ readonly envVarsKey: Schema.optional<Schema.NonEmptyString>;
1015
1017
  }>;
1016
1018
  /** @experimental This API is unstable and may change without notice. */
1017
1019
  export type McpStdioDialect = Schema.Schema.Type<typeof McpStdioDialectSchema>;
@@ -1090,6 +1092,8 @@ export declare const McpConfigSchema: Schema.Struct<{
1090
1092
  }>;
1091
1093
  readonly command: Schema.Literals<readonly ["split", "array"]>;
1092
1094
  readonly envKey: Schema.NullOr<Schema.NonEmptyString>;
1095
+ /** Native allowlist for forwarding same-name environment variables. */
1096
+ readonly envVarsKey: Schema.optional<Schema.NonEmptyString>;
1093
1097
  }>>;
1094
1098
  readonly remote: Schema.NullOr<Schema.Struct<{
1095
1099
  readonly typeField: Schema.Struct<{
@@ -1234,6 +1238,8 @@ export declare const McpExtensionCapabilitySchema: Schema.Union<readonly [Schema
1234
1238
  }>;
1235
1239
  readonly command: Schema.Literals<readonly ["split", "array"]>;
1236
1240
  readonly envKey: Schema.NullOr<Schema.NonEmptyString>;
1241
+ /** Native allowlist for forwarding same-name environment variables. */
1242
+ readonly envVarsKey: Schema.optional<Schema.NonEmptyString>;
1237
1243
  }>>;
1238
1244
  readonly remote: Schema.NullOr<Schema.Struct<{
1239
1245
  readonly typeField: Schema.Struct<{
@@ -1337,6 +1343,8 @@ export declare const McpExtensionCapabilitySchema: Schema.Union<readonly [Schema
1337
1343
  }>;
1338
1344
  readonly command: Schema.Literals<readonly ["split", "array"]>;
1339
1345
  readonly envKey: Schema.NullOr<Schema.NonEmptyString>;
1346
+ /** Native allowlist for forwarding same-name environment variables. */
1347
+ readonly envVarsKey: Schema.optional<Schema.NonEmptyString>;
1340
1348
  }>>;
1341
1349
  readonly remote: Schema.NullOr<Schema.Struct<{
1342
1350
  readonly typeField: Schema.Struct<{
@@ -2147,6 +2155,8 @@ export declare const AgentCapabilitiesSchema: Schema.Struct<{
2147
2155
  }>;
2148
2156
  readonly command: Schema.Literals<readonly ["split", "array"]>;
2149
2157
  readonly envKey: Schema.NullOr<Schema.NonEmptyString>;
2158
+ /** Native allowlist for forwarding same-name environment variables. */
2159
+ readonly envVarsKey: Schema.optional<Schema.NonEmptyString>;
2150
2160
  }>>;
2151
2161
  readonly remote: Schema.NullOr<Schema.Struct<{
2152
2162
  readonly typeField: Schema.Struct<{
@@ -2250,6 +2260,8 @@ export declare const AgentCapabilitiesSchema: Schema.Struct<{
2250
2260
  }>;
2251
2261
  readonly command: Schema.Literals<readonly ["split", "array"]>;
2252
2262
  readonly envKey: Schema.NullOr<Schema.NonEmptyString>;
2263
+ /** Native allowlist for forwarding same-name environment variables. */
2264
+ readonly envVarsKey: Schema.optional<Schema.NonEmptyString>;
2253
2265
  }>>;
2254
2266
  readonly remote: Schema.NullOr<Schema.Struct<{
2255
2267
  readonly typeField: Schema.Struct<{
@@ -2988,6 +3000,8 @@ export declare const AgentSchema: Schema.Struct<{
2988
3000
  }>;
2989
3001
  readonly command: Schema.Literals<readonly ["split", "array"]>;
2990
3002
  readonly envKey: Schema.NullOr<Schema.NonEmptyString>;
3003
+ /** Native allowlist for forwarding same-name environment variables. */
3004
+ readonly envVarsKey: Schema.optional<Schema.NonEmptyString>;
2991
3005
  }>>;
2992
3006
  readonly remote: Schema.NullOr<Schema.Struct<{
2993
3007
  readonly typeField: Schema.Struct<{
@@ -3091,6 +3105,8 @@ export declare const AgentSchema: Schema.Struct<{
3091
3105
  }>;
3092
3106
  readonly command: Schema.Literals<readonly ["split", "array"]>;
3093
3107
  readonly envKey: Schema.NullOr<Schema.NonEmptyString>;
3108
+ /** Native allowlist for forwarding same-name environment variables. */
3109
+ readonly envVarsKey: Schema.optional<Schema.NonEmptyString>;
3094
3110
  }>>;
3095
3111
  readonly remote: Schema.NullOr<Schema.Struct<{
3096
3112
  readonly typeField: Schema.Struct<{
@@ -607,6 +607,8 @@ export const McpStdioDialectSchema = Schema.Struct({
607
607
  typeField: McpTypeFieldSchema,
608
608
  command: Schema.Literals(["split", "array"]),
609
609
  envKey: Schema.NullOr(Schema.NonEmptyString),
610
+ /** Native allowlist for forwarding same-name environment variables. */
611
+ envVarsKey: Schema.optional(Schema.NonEmptyString),
610
612
  }).annotate({
611
613
  identifier: "McpStdioDialect",
612
614
  title: "MCP Stdio Dialect",
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Glob expansion for extension names.
3
+ *
4
+ * Expands `*` wildcards against a list of names. Only `*` is supported
5
+ * as a wildcard — all other characters are treated as literals.
6
+ *
7
+ * @experimental This API is unstable and may change without notice.
8
+ */
9
+ /**
10
+ * Expand a glob pattern against a list of names.
11
+ *
12
+ * Only `*` wildcards are supported. All other characters (including `?`, `[`, `]`)
13
+ * are treated as literals. Matching is case-sensitive.
14
+ *
15
+ * @param pattern - The pattern to match (may contain `*`)
16
+ * @param names - Available names to match against
17
+ * @returns Matching names in their original order
18
+ */
19
+ export declare const expandGlob: (pattern: string, names: ReadonlyArray<string>) => ReadonlyArray<string>;
20
+ /**
21
+ * Expand multiple glob patterns against a list of extension names.
22
+ *
23
+ * Returns the union of all matches, deduplicated, preserving the original
24
+ * order of `names`.
25
+ *
26
+ * @param patterns - Patterns to match (may contain `*`)
27
+ * @param names - Available names to match against
28
+ * @returns Matching names in their original order, deduplicated
29
+ */
30
+ export declare const expandGlobs: (patterns: ReadonlyArray<string>, names: ReadonlyArray<string>) => ReadonlyArray<string>;
31
+ /**
32
+ * Returns true when an input should be treated as a glob pattern.
33
+ */
34
+ export declare const isGlobPattern: (input: string) => boolean;
35
+ //# sourceMappingURL=name-patterns.d.ts.map
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Glob expansion for extension names.
3
+ *
4
+ * Expands `*` wildcards against a list of names. Only `*` is supported
5
+ * as a wildcard — all other characters are treated as literals.
6
+ *
7
+ * @experimental This API is unstable and may change without notice.
8
+ */
9
+ /**
10
+ * Expand a glob pattern against a list of names.
11
+ *
12
+ * Only `*` wildcards are supported. All other characters (including `?`, `[`, `]`)
13
+ * are treated as literals. Matching is case-sensitive.
14
+ *
15
+ * @param pattern - The pattern to match (may contain `*`)
16
+ * @param names - Available names to match against
17
+ * @returns Matching names in their original order
18
+ */
19
+ export const expandGlob = (pattern, names) => {
20
+ const matches = (name) => {
21
+ let patternIndex = 0;
22
+ let nameIndex = 0;
23
+ let wildcardIndex = -1;
24
+ let wildcardNameIndex = 0;
25
+ while (nameIndex < name.length) {
26
+ const token = pattern[patternIndex];
27
+ if (token !== undefined && token !== "*" && token === name[nameIndex]) {
28
+ patternIndex += 1;
29
+ nameIndex += 1;
30
+ }
31
+ else if (token === "*") {
32
+ wildcardIndex = patternIndex;
33
+ wildcardNameIndex = nameIndex;
34
+ patternIndex += 1;
35
+ }
36
+ else if (wildcardIndex >= 0) {
37
+ patternIndex = wildcardIndex + 1;
38
+ wildcardNameIndex += 1;
39
+ nameIndex = wildcardNameIndex;
40
+ }
41
+ else {
42
+ return false;
43
+ }
44
+ }
45
+ while (pattern[patternIndex] === "*") {
46
+ patternIndex += 1;
47
+ }
48
+ return patternIndex === pattern.length;
49
+ };
50
+ return names.filter(matches);
51
+ };
52
+ /**
53
+ * Expand multiple glob patterns against a list of extension names.
54
+ *
55
+ * Returns the union of all matches, deduplicated, preserving the original
56
+ * order of `names`.
57
+ *
58
+ * @param patterns - Patterns to match (may contain `*`)
59
+ * @param names - Available names to match against
60
+ * @returns Matching names in their original order, deduplicated
61
+ */
62
+ export const expandGlobs = (patterns, names) => {
63
+ const matched = new Set();
64
+ for (const pattern of patterns) {
65
+ for (const name of expandGlob(pattern, names)) {
66
+ matched.add(name);
67
+ }
68
+ }
69
+ return names.filter((n) => matched.has(n));
70
+ };
71
+ /**
72
+ * Returns true when an input should be treated as a glob pattern.
73
+ */
74
+ export const isGlobPattern = (input) => input.includes("*");
75
+ //# sourceMappingURL=name-patterns.js.map
@@ -0,0 +1,58 @@
1
+ import type { ExtensionFqnParts, ExtensionType, ExtensionVisibility } from "../extensions/common.js";
2
+ import type { DeprecationView } from "../extensions/deprecation.js";
3
+ import { type Version, type VersionRange } from "../version-constraints/version-constraints.js";
4
+ export interface PackDependencyTarget extends ExtensionFqnParts {
5
+ readonly type: Exclude<ExtensionType, "pack">;
6
+ }
7
+ export interface PackDependency extends PackDependencyTarget {
8
+ readonly range: VersionRange;
9
+ }
10
+ /** Registry facts are independent of the constraint chosen by any one pack. */
11
+ export interface PackDependencySnapshot {
12
+ readonly target: PackDependencyTarget;
13
+ readonly exists: boolean;
14
+ readonly visibility: ExtensionVisibility | null;
15
+ readonly lifecycleState: "active" | "unavailable" | null;
16
+ readonly deprecation: DeprecationView | null;
17
+ readonly versions: ReadonlyArray<{
18
+ readonly version: Version;
19
+ readonly status: "available" | "unavailable";
20
+ readonly yanked: boolean;
21
+ readonly purged: boolean;
22
+ }>;
23
+ }
24
+ export type PackPublicationCandidate = {
25
+ readonly target: ExtensionFqnParts;
26
+ readonly kind: "unavailable";
27
+ } | {
28
+ readonly target: ExtensionFqnParts & {
29
+ readonly version: Version;
30
+ };
31
+ readonly kind: "resolved";
32
+ readonly participation: "publish" | "verified-existing";
33
+ readonly visibility: ExtensionVisibility | null;
34
+ };
35
+ /** Findings contain only disclosable domain facts; interfaces own their wording. */
36
+ export interface PackDependencyPolicyFinding {
37
+ readonly dependency: PackDependency;
38
+ readonly severity: "error" | "warning";
39
+ readonly reason: "missing" | "not-public" | "selected-unavailable" | "selected-new-private" | "selected-existing-private" | "lifecycle-unavailable" | "no-installable-version" | "range-unsatisfied" | "deprecated";
40
+ readonly effectiveVisibility?: ExtensionVisibility;
41
+ readonly lifecycle?: "active" | "unavailable";
42
+ readonly deprecation?: DeprecationView;
43
+ }
44
+ export interface PackDependencyPolicyResult {
45
+ readonly findings: ReadonlyArray<PackDependencyPolicyFinding>;
46
+ readonly resolutions: ReadonlyArray<{
47
+ readonly dependency: PackDependency;
48
+ readonly effectiveVersion: Version;
49
+ }>;
50
+ }
51
+ /** Evaluate admission and version selection once against the same prospective facts. */
52
+ export declare const evaluatePackDependencies: (input: {
53
+ readonly packVisibility: ExtensionVisibility;
54
+ readonly dependencies: ReadonlyArray<PackDependency>;
55
+ readonly snapshots: ReadonlyArray<PackDependencySnapshot>;
56
+ readonly candidates?: ReadonlyArray<PackPublicationCandidate>;
57
+ }) => PackDependencyPolicyResult;
58
+ //# sourceMappingURL=dependency-policy.d.ts.map
@@ -0,0 +1,90 @@
1
+ import * as semver from "semver";
2
+ import { formatFqn } from "../extensions/fqn.js";
3
+ import { decodeVersionSync, } from "../version-constraints/version-constraints.js";
4
+ const identityKey = (target) => `${target.owner}\u0000${target.type}\u0000${target.name}`;
5
+ const disclosedState = (snapshot) => ({
6
+ ...(snapshot.visibility === null ? {} : { effectiveVisibility: snapshot.visibility }),
7
+ ...(snapshot.lifecycleState === null ? {} : { lifecycle: snapshot.lifecycleState }),
8
+ });
9
+ const evaluateDependency = (dependency, current, selected, packVisibility) => {
10
+ const reject = (reason, state = {}) => ({
11
+ findings: [{ dependency, severity: "error", reason, ...state }],
12
+ resolutions: [],
13
+ });
14
+ if (selected?.kind === "unavailable")
15
+ return reject("selected-unavailable");
16
+ if (packVisibility === "public" && selected?.visibility === "private") {
17
+ return reject(current.exists ? "selected-existing-private" : "selected-new-private", {
18
+ ...disclosedState(current),
19
+ effectiveVisibility: "private",
20
+ });
21
+ }
22
+ const prospective = selected === undefined
23
+ ? current
24
+ : {
25
+ ...current,
26
+ exists: true,
27
+ visibility: selected.visibility ?? current.visibility,
28
+ lifecycleState: current.exists ? current.lifecycleState : "active",
29
+ versions: selected.participation === "publish"
30
+ ? [
31
+ ...current.versions,
32
+ {
33
+ version: selected.target.version,
34
+ status: "available",
35
+ yanked: false,
36
+ purged: false,
37
+ },
38
+ ]
39
+ : current.versions,
40
+ };
41
+ if (!prospective.exists)
42
+ return reject("missing");
43
+ if (packVisibility === "public" && prospective.visibility !== "public")
44
+ return reject("not-public");
45
+ const state = disclosedState(prospective);
46
+ if (prospective.lifecycleState !== "active")
47
+ return reject("lifecycle-unavailable", state);
48
+ const installable = prospective.versions.filter((version) => version.status === "available" && !version.yanked && !version.purged);
49
+ if (installable.length === 0)
50
+ return reject("no-installable-version", state);
51
+ const effectiveVersion = semver.maxSatisfying(installable.map((version) => version.version), dependency.range);
52
+ if (effectiveVersion === null)
53
+ return reject("range-unsatisfied", state);
54
+ return {
55
+ findings: prospective.deprecation === null
56
+ ? []
57
+ : [
58
+ {
59
+ dependency,
60
+ severity: "warning",
61
+ reason: "deprecated",
62
+ effectiveVisibility: prospective.visibility === "private" ? "private" : "public",
63
+ lifecycle: "active",
64
+ deprecation: prospective.deprecation,
65
+ },
66
+ ],
67
+ resolutions: [{ dependency, effectiveVersion: decodeVersionSync(effectiveVersion) }],
68
+ };
69
+ };
70
+ /** Evaluate admission and version selection once against the same prospective facts. */
71
+ export const evaluatePackDependencies = (input) => {
72
+ const snapshots = new Map(input.snapshots.map((snapshot) => [identityKey(snapshot.target), snapshot]));
73
+ const candidates = new Map((input.candidates ?? []).map((candidate) => [identityKey(candidate.target), candidate]));
74
+ const compare = (left, right) => (left < right ? -1 : left > right ? 1 : 0);
75
+ const evaluated = [...input.dependencies]
76
+ .sort((left, right) => compare(formatFqn(left), formatFqn(right)) || compare(left.range, right.range))
77
+ .map((dependency) => evaluateDependency(dependency, snapshots.get(identityKey(dependency)) ?? {
78
+ target: dependency,
79
+ exists: false,
80
+ visibility: null,
81
+ lifecycleState: null,
82
+ deprecation: null,
83
+ versions: [],
84
+ }, candidates.get(identityKey(dependency)), input.packVisibility));
85
+ return {
86
+ findings: evaluated.flatMap((result) => result.findings),
87
+ resolutions: evaluated.flatMap((result) => result.resolutions),
88
+ };
89
+ };
90
+ //# sourceMappingURL=dependency-policy.js.map
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "description": "Shared AgentXM extension model: identities, manifests, version constraints, and agent capabilities. Unstable and unsupported — use the axm.sh CLI.",
13
13
  "devDependencies": {
14
- "@agentxm/specification-metadata": "0.30.1",
14
+ "@agentxm/specification-metadata": "0.31.0",
15
15
  "@effect/vitest": "4.0.0-rc.115",
16
16
  "@fast-check/vitest": "^0.5.0",
17
17
  "@types/semver": "^7.7.1",
@@ -196,6 +196,10 @@
196
196
  "types": "./dist/src/unstable/packaging/package-url.d.ts",
197
197
  "default": "./dist/src/unstable/packaging/package-url.js"
198
198
  },
199
+ "./unstable/packs/dependency-policy": {
200
+ "types": "./dist/src/unstable/packs/dependency-policy.d.ts",
201
+ "default": "./dist/src/unstable/packs/dependency-policy.js"
202
+ },
199
203
  "./unstable/packs/manifest-schema": {
200
204
  "types": "./dist/src/unstable/packs/manifest-schema.d.ts",
201
205
  "default": "./dist/src/unstable/packs/manifest-schema.js"
@@ -267,6 +271,10 @@
267
271
  "./unstable/workspace-scope": {
268
272
  "types": "./dist/src/unstable/workspace-scope.d.ts",
269
273
  "default": "./dist/src/unstable/workspace-scope.js"
274
+ },
275
+ "./unstable/extensions/name-patterns": {
276
+ "types": "./dist/src/unstable/extensions/name-patterns.d.ts",
277
+ "default": "./dist/src/unstable/extensions/name-patterns.js"
270
278
  }
271
279
  },
272
280
  "files": [
@@ -289,5 +297,5 @@
289
297
  },
290
298
  "sideEffects": false,
291
299
  "type": "module",
292
- "version": "0.30.1"
300
+ "version": "0.31.0"
293
301
  }