@agentxm/extension-model 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/unstable/agent-capabilities/derive.js +1 -3
- package/dist/src/unstable/agent-capabilities/identity.d.ts +2 -0
- package/dist/src/unstable/agent-capabilities/identity.js +3 -0
- package/dist/src/unstable/agent-capabilities/index.d.ts +1 -1
- package/dist/src/unstable/agent-capabilities/index.js +1 -1
- package/dist/src/unstable/agents/registry.d.ts +3 -17
- package/dist/src/unstable/agents/registry.js +2 -17
- package/dist/src/unstable/agents/types.d.ts +5 -7
- package/dist/src/unstable/agents/types.js +2 -4
- package/dist/src/unstable/extensions/common.d.ts +20 -8
- package/dist/src/unstable/extensions/common.js +29 -32
- package/dist/src/unstable/extensions/deprecation.d.ts +24 -3
- package/dist/src/unstable/extensions/deprecation.js +22 -3
- package/dist/src/unstable/extensions/index.d.ts +1 -1
- package/dist/src/unstable/extensions/index.js +1 -1
- package/dist/src/unstable/extensions/name-patterns.d.ts +5 -3
- package/dist/src/unstable/extensions/name-patterns.js +31 -32
- package/dist/src/unstable/extensions/refs/extension-ref.d.ts +9 -0
- package/dist/src/unstable/extensions/refs/extension-ref.js +25 -1
- package/dist/src/unstable/extensions/registry-source.d.ts +12 -2
- package/dist/src/unstable/extensions/registry-source.js +17 -32
- package/dist/src/unstable/path-types.d.ts +6 -0
- package/dist/src/unstable/path-types.js +20 -0
- package/dist/src/unstable/sources/forge-grammar.d.ts +46 -10
- package/dist/src/unstable/sources/forge-grammar.js +153 -33
- package/dist/src/unstable/sources/parser.d.ts +9 -7
- package/dist/src/unstable/sources/parser.js +14 -31
- package/dist/src/unstable/sources/printer.js +10 -35
- package/dist/src/unstable/sources/source-host-provider.d.ts +10 -6
- package/dist/src/unstable/sources/types.d.ts +1 -93
- package/dist/src/unstable/sources/types.js +1 -48
- package/dist/src/unstable/version-constraints/version-constraints.d.ts +9 -11
- package/dist/src/unstable/version-constraints/version-constraints.js +14 -43
- package/package.json +3 -3
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { PER_AGENT_EXTENSION_TYPES } from "../extensions/common.js";
|
|
7
7
|
import { AGENTS } from "./catalog.js";
|
|
8
|
-
import {
|
|
8
|
+
import { isConfigurableAgentId } from "./identity.js";
|
|
9
9
|
import { LEAF_EXTENSION_TYPES } from "../extension-types/schema.js";
|
|
10
10
|
import { SUPPORTED_AXM_SUPPORT, } from "./schema.js";
|
|
11
11
|
import {} from "../extensions/common.js";
|
|
@@ -43,8 +43,6 @@ const capabilityForType = (agent, type) => {
|
|
|
43
43
|
return agent.capabilities[type];
|
|
44
44
|
return undefined;
|
|
45
45
|
};
|
|
46
|
-
const configurableAgentIds = new Set(CONFIGURABLE_AGENT_IDS);
|
|
47
|
-
const isConfigurableAgentId = (id) => configurableAgentIds.has(id);
|
|
48
46
|
const deriveAgentId = (agent) => {
|
|
49
47
|
if (isConfigurableAgentId(agent.id))
|
|
50
48
|
return agent.id;
|
|
@@ -5,6 +5,8 @@ export declare const CONFIGURABLE_AGENT_IDS: readonly ["adal", "aider-desk", "am
|
|
|
5
5
|
/** @experimental This API is unstable and may change without notice. */
|
|
6
6
|
export type ConfigurableAgentId = (typeof CONFIGURABLE_AGENT_IDS)[number];
|
|
7
7
|
/** @experimental This API is unstable and may change without notice. */
|
|
8
|
+
export declare const isConfigurableAgentId: (id: string) => id is ConfigurableAgentId;
|
|
9
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
8
10
|
export declare const HOSTED_AGENT_IDS: readonly ["chatgpt", "claude-ai", "cowork", "gemini-app"];
|
|
9
11
|
/** @experimental This API is unstable and may change without notice. */
|
|
10
12
|
export type HostedAgentId = (typeof HOSTED_AGENT_IDS)[number];
|
|
@@ -65,6 +65,9 @@ export const CONFIGURABLE_AGENT_IDS = [
|
|
|
65
65
|
"zed",
|
|
66
66
|
"zenflow",
|
|
67
67
|
];
|
|
68
|
+
const configurableAgentIdSet = new Set(CONFIGURABLE_AGENT_IDS);
|
|
69
|
+
/** @experimental This API is unstable and may change without notice. */
|
|
70
|
+
export const isConfigurableAgentId = (id) => configurableAgentIdSet.has(id);
|
|
68
71
|
/** @experimental This API is unstable and may change without notice. */
|
|
69
72
|
export const HOSTED_AGENT_IDS = ["chatgpt", "claude-ai", "cowork", "gemini-app"];
|
|
70
73
|
/** @experimental This API is unstable and may change without notice. */
|
|
@@ -11,6 +11,6 @@ export { STANDARDS } from "../extension-types/standards.js";
|
|
|
11
11
|
export { CAPABILITY_VERIFICATION_BUDGET_DAYS, capabilityVerificationAgeReport, type AgentCapabilitySlot, type CapabilityVerificationAge, } from "./verification.js";
|
|
12
12
|
export { agentCapabilityStatus, agentSupportsType, axmIntegrationStatus, canonicalCoverage, deriveAgentDescriptor, deriveSkillConvention, deriveHookPortability, getSupportedAgentsForExtension, getSupportedAgentsForExtensionType, getSupportedAgentsForExtensionTypes, getSupportedExtensionTypesForAgent, isCapabilitySupported, isLeafExtensionType, listCapabilities, installable, toNativeAgent, type AgentCapabilityStatus, type AxmIntegrationStatus, type CapabilityListing, type ExtensionCompatibilityInput, type HookDecisionKind, type HookDecisionRequirement, type HookInstallabilityVerdict, type HookInstallBinding, type HookPortabilityRequirement, type HookPortabilityVerdict, type NativeAgent, type NativeAgentCapabilities, } from "./derive.js";
|
|
13
13
|
export { AGENTS, AGENTS_BY_ID, CONFIGURABLE_AGENTS_BY_ID, HOSTED_AGENTS_BY_ID } from "./catalog.js";
|
|
14
|
-
export { AGENT_IDS, AgentIdSchema, CONFIGURABLE_AGENT_IDS, HOSTED_AGENT_IDS, type AgentId, type ConfigurableAgentId, type HostedAgentId, } from "./identity.js";
|
|
14
|
+
export { AGENT_IDS, AgentIdSchema, CONFIGURABLE_AGENT_IDS, HOSTED_AGENT_IDS, isConfigurableAgentId, type AgentId, type ConfigurableAgentId, type HostedAgentId, } from "./identity.js";
|
|
15
15
|
export { agentById } from "./lookup.js";
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -11,6 +11,6 @@ export { STANDARDS } from "../extension-types/standards.js";
|
|
|
11
11
|
export { CAPABILITY_VERIFICATION_BUDGET_DAYS, capabilityVerificationAgeReport, } from "./verification.js";
|
|
12
12
|
export { agentCapabilityStatus, agentSupportsType, axmIntegrationStatus, canonicalCoverage, deriveAgentDescriptor, deriveSkillConvention, deriveHookPortability, getSupportedAgentsForExtension, getSupportedAgentsForExtensionType, getSupportedAgentsForExtensionTypes, getSupportedExtensionTypesForAgent, isCapabilitySupported, isLeafExtensionType, listCapabilities, installable, toNativeAgent, } from "./derive.js";
|
|
13
13
|
export { AGENTS, AGENTS_BY_ID, CONFIGURABLE_AGENTS_BY_ID, HOSTED_AGENTS_BY_ID } from "./catalog.js";
|
|
14
|
-
export { AGENT_IDS, AgentIdSchema, CONFIGURABLE_AGENT_IDS, HOSTED_AGENT_IDS, } from "./identity.js";
|
|
14
|
+
export { AGENT_IDS, AgentIdSchema, CONFIGURABLE_AGENT_IDS, HOSTED_AGENT_IDS, isConfigurableAgentId, } from "./identity.js";
|
|
15
15
|
export { agentById } from "./lookup.js";
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -6,28 +6,14 @@
|
|
|
6
6
|
* @experimental This API is unstable and may change without notice.
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
9
|
+
import type { AgentRegistry } from "./types.js";
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Derived descriptors for all known AI coding agents, including the synthetic universal target.
|
|
12
12
|
*
|
|
13
13
|
* Keys are agent IDs, values are full descriptor objects.
|
|
14
14
|
* Paths are pre-expanded at module initialization.
|
|
15
15
|
*
|
|
16
16
|
* @experimental This API is unstable and may change without notice.
|
|
17
17
|
*/
|
|
18
|
-
export declare const
|
|
19
|
-
/**
|
|
20
|
-
* Get all registered agent IDs.
|
|
21
|
-
*
|
|
22
|
-
* @returns Array of all agent identifiers
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* const ids = getAgentIds();
|
|
27
|
-
* // ["adal", "amp", "antigravity", "augment", "claude-code", ...]
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* @experimental This API is unstable and may change without notice.
|
|
31
|
-
*/
|
|
32
|
-
export declare const getAgentIds: () => ReadonlyArray<AgentId>;
|
|
18
|
+
export declare const AGENT_DESCRIPTORS: AgentRegistry;
|
|
33
19
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -10,7 +10,6 @@ import * as Record from "effect/Record";
|
|
|
10
10
|
import { CONFIGURABLE_AGENTS_BY_ID } from "../agent-capabilities/catalog.js";
|
|
11
11
|
import { deriveAgentDescriptor } from "../agent-capabilities/derive.js";
|
|
12
12
|
import { UNIVERSAL_SKILLS_DIR } from "../extensions/universal-skills-dir.js";
|
|
13
|
-
import { AGENT_IDS } from "./types.js";
|
|
14
13
|
const UNIVERSAL_AGENT_DESCRIPTOR = {
|
|
15
14
|
id: "universal",
|
|
16
15
|
name: "Universal",
|
|
@@ -22,29 +21,15 @@ const UNIVERSAL_AGENT_DESCRIPTOR = {
|
|
|
22
21
|
detection: { project: { markers: [] }, user: { markers: [] } },
|
|
23
22
|
};
|
|
24
23
|
/**
|
|
25
|
-
*
|
|
24
|
+
* Derived descriptors for all known AI coding agents, including the synthetic universal target.
|
|
26
25
|
*
|
|
27
26
|
* Keys are agent IDs, values are full descriptor objects.
|
|
28
27
|
* Paths are pre-expanded at module initialization.
|
|
29
28
|
*
|
|
30
29
|
* @experimental This API is unstable and may change without notice.
|
|
31
30
|
*/
|
|
32
|
-
export const
|
|
31
|
+
export const AGENT_DESCRIPTORS = {
|
|
33
32
|
...Record.map(CONFIGURABLE_AGENTS_BY_ID, deriveAgentDescriptor),
|
|
34
33
|
universal: UNIVERSAL_AGENT_DESCRIPTOR,
|
|
35
34
|
};
|
|
36
|
-
/**
|
|
37
|
-
* Get all registered agent IDs.
|
|
38
|
-
*
|
|
39
|
-
* @returns Array of all agent identifiers
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```typescript
|
|
43
|
-
* const ids = getAgentIds();
|
|
44
|
-
* // ["adal", "amp", "antigravity", "augment", "claude-code", ...]
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* @experimental This API is unstable and may change without notice.
|
|
48
|
-
*/
|
|
49
|
-
export const getAgentIds = () => AGENT_IDS;
|
|
50
35
|
//# sourceMappingURL=registry.js.map
|
|
@@ -74,12 +74,10 @@ export interface AgentDetectionDescriptor {
|
|
|
74
74
|
}
|
|
75
75
|
/** @experimental This API is unstable and may change without notice. */
|
|
76
76
|
export { CONFIGURABLE_AGENT_IDS, type ConfigurableAgentId };
|
|
77
|
+
/** Configurable agents plus the synthetic universal materialization target. @experimental */
|
|
78
|
+
export declare const MATERIALIZATION_TARGET_IDS: readonly ["adal", "aider-desk", "amp", "antigravity", "antigravity-cli", "augment", "claude-code", "cline", "codearts-agent", "codebuddy", "codemaker", "codestudio", "codex", "command-code", "continue", "cortex", "crush", "cursor", "deepagents", "devin", "dexto", "droid", "firebender", "forgecode", "gemini-cli", "github-copilot-cli", "goose", "grok-cli", "hermes", "ibm-bob", "iflow-cli", "junie", "lingma", "kilo", "kimi-cli", "kiro-cli", "kode", "mcpjam", "minimax-code", "mistral-vibe", "mux", "neovate", "openclaw", "opencode", "openhands", "ona", "pi", "pochi", "qoder", "qoder-cn", "qwen-code", "replit", "roo", "rovodev", "tabnine-cli", "trae-cn", "trae", "warp", "windsurf", "zencoder", "zed", "zenflow", "universal"];
|
|
77
79
|
/** @experimental This API is unstable and may change without notice. */
|
|
78
|
-
export
|
|
79
|
-
/** @experimental This API is unstable and may change without notice. */
|
|
80
|
-
export type AgentId = (typeof AGENT_IDS)[number];
|
|
81
|
-
/** @experimental This API is unstable and may change without notice. */
|
|
82
|
-
export declare const isConfigurableAgentId: (id: AgentId) => id is ConfigurableAgentId;
|
|
80
|
+
export type MaterializationTargetId = (typeof MATERIALIZATION_TARGET_IDS)[number];
|
|
83
81
|
/**
|
|
84
82
|
* Configuration for an AI coding agent.
|
|
85
83
|
*
|
|
@@ -87,7 +85,7 @@ export declare const isConfigurableAgentId: (id: AgentId) => id is ConfigurableA
|
|
|
87
85
|
*/
|
|
88
86
|
export interface AgentDescriptor {
|
|
89
87
|
/** Unique identifier (e.g., "claude-code") */
|
|
90
|
-
readonly id:
|
|
88
|
+
readonly id: MaterializationTargetId;
|
|
91
89
|
/** Human-readable display name (e.g., "Claude Code") */
|
|
92
90
|
readonly name: string;
|
|
93
91
|
/**
|
|
@@ -122,5 +120,5 @@ export interface AgentDescriptor {
|
|
|
122
120
|
*
|
|
123
121
|
* @experimental This API is unstable and may change without notice.
|
|
124
122
|
*/
|
|
125
|
-
export type AgentRegistry = Record.ReadonlyRecord<
|
|
123
|
+
export type AgentRegistry = Record.ReadonlyRecord<MaterializationTargetId, AgentDescriptor>;
|
|
126
124
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -10,8 +10,6 @@ import { CONFIGURABLE_AGENT_IDS, } from "../agent-capabilities/identity.js";
|
|
|
10
10
|
// -----------------------------------------------------------------------------
|
|
11
11
|
/** @experimental This API is unstable and may change without notice. */
|
|
12
12
|
export { CONFIGURABLE_AGENT_IDS };
|
|
13
|
-
/**
|
|
14
|
-
export const
|
|
15
|
-
/** @experimental This API is unstable and may change without notice. */
|
|
16
|
-
export const isConfigurableAgentId = (id) => id !== "universal";
|
|
13
|
+
/** Configurable agents plus the synthetic universal materialization target. @experimental */
|
|
14
|
+
export const MATERIALIZATION_TARGET_IDS = [...CONFIGURABLE_AGENT_IDS, "universal"];
|
|
17
15
|
//# sourceMappingURL=types.js.map
|
|
@@ -427,6 +427,26 @@ export type ExtensionFqnParts = Schema.Schema.Type<typeof ExtensionFqnPartsSchem
|
|
|
427
427
|
* @experimental This API is unstable and may change without notice.
|
|
428
428
|
*/
|
|
429
429
|
export declare const parseExtensionFqnParts: (input: string) => ExtensionFqnParts | undefined;
|
|
430
|
+
/**
|
|
431
|
+
* A reference split into the name it identifies and the constraint appended
|
|
432
|
+
* to it. The constraint is everything after the first `@` that follows the
|
|
433
|
+
* last `/`, because the owner segment also starts with `@`; a trailing `@`
|
|
434
|
+
* yields an empty constraint for the caller to reject.
|
|
435
|
+
*
|
|
436
|
+
* @experimental This API is unstable and may change without notice.
|
|
437
|
+
*/
|
|
438
|
+
export interface SplitExtensionReference {
|
|
439
|
+
readonly name: string;
|
|
440
|
+
readonly constraint: string | undefined;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Split `@owner/<plural>/name[@constraint]` into its name and constraint.
|
|
444
|
+
* This is the one place the separator between a name and its constraint is
|
|
445
|
+
* decided.
|
|
446
|
+
*
|
|
447
|
+
* @experimental This API is unstable and may change without notice.
|
|
448
|
+
*/
|
|
449
|
+
export declare const splitExtensionReference: (input: string) => SplitExtensionReference;
|
|
430
450
|
/**
|
|
431
451
|
* Parse an extension spec string (with optional version constraint) into parts.
|
|
432
452
|
* Strips the version constraint suffix and returns the validated FQN parts.
|
|
@@ -477,14 +497,6 @@ export declare const PackFqnSchema: Schema.String;
|
|
|
477
497
|
* @experimental This API is unstable and may change without notice.
|
|
478
498
|
*/
|
|
479
499
|
export type PackFqn = Schema.Schema.Type<typeof PackFqnSchema>;
|
|
480
|
-
/**
|
|
481
|
-
* Extension spec — fully qualified extension name with an optional version
|
|
482
|
-
* constraint suffix. Accepts `@owner/type/name` or `@owner/type/name@constraint`
|
|
483
|
-
* where the FQN portion validates through ExtensionFqnSchema and the optional
|
|
484
|
-
* constraint validates as a semver VersionRange.
|
|
485
|
-
*
|
|
486
|
-
* @experimental This API is unstable and may change without notice.
|
|
487
|
-
*/
|
|
488
500
|
export declare const ExtensionSpecSchema: Schema.brand<Schema.NonEmptyString, "ExtensionSpec">;
|
|
489
501
|
/**
|
|
490
502
|
* Inferred type for ExtensionSpec schema.
|
|
@@ -360,17 +360,26 @@ export const parseExtensionFqnParts = (input) => {
|
|
|
360
360
|
return Result.isSuccess(result) ? result.success : undefined;
|
|
361
361
|
};
|
|
362
362
|
/**
|
|
363
|
-
*
|
|
364
|
-
*
|
|
363
|
+
* Split `@owner/<plural>/name[@constraint]` into its name and constraint.
|
|
364
|
+
* This is the one place the separator between a name and its constraint is
|
|
365
|
+
* decided.
|
|
365
366
|
*
|
|
366
367
|
* @experimental This API is unstable and may change without notice.
|
|
367
368
|
*/
|
|
368
|
-
export const
|
|
369
|
+
export const splitExtensionReference = (input) => {
|
|
369
370
|
const lastSlash = input.lastIndexOf("/");
|
|
370
371
|
const constraintAt = lastSlash > 0 ? input.indexOf("@", lastSlash + 1) : -1;
|
|
371
|
-
|
|
372
|
-
|
|
372
|
+
return constraintAt > 0
|
|
373
|
+
? { name: input.slice(0, constraintAt), constraint: input.slice(constraintAt + 1) }
|
|
374
|
+
: { name: input, constraint: undefined };
|
|
373
375
|
};
|
|
376
|
+
/**
|
|
377
|
+
* Parse an extension spec string (with optional version constraint) into parts.
|
|
378
|
+
* Strips the version constraint suffix and returns the validated FQN parts.
|
|
379
|
+
*
|
|
380
|
+
* @experimental This API is unstable and may change without notice.
|
|
381
|
+
*/
|
|
382
|
+
export const parseExtensionSpecParts = (input) => parseExtensionFqnParts(splitExtensionReference(input).name);
|
|
374
383
|
const INVALID_EXTENSION_FQN_MESSAGE = "Expected fully qualified name in @handle/(skills|mcps|subagents|rules|hooks|knowledge|packs)/name form";
|
|
375
384
|
/**
|
|
376
385
|
* Fully qualified name string schema validated against the composed handle,
|
|
@@ -425,24 +434,21 @@ export const PackFqnSchema = Schema.String.pipe(Schema.check(Schema.isPattern(PA
|
|
|
425
434
|
*
|
|
426
435
|
* @experimental This API is unstable and may change without notice.
|
|
427
436
|
*/
|
|
437
|
+
/** The constraint issue of a split reference, or none when it has none or it is valid. */
|
|
438
|
+
const constraintIssue = (constraint) => {
|
|
439
|
+
if (constraint === undefined)
|
|
440
|
+
return undefined;
|
|
441
|
+
const constraintResult = Schema.decodeUnknownResult(VersionRangeSchema)(constraint);
|
|
442
|
+
return Result.isFailure(constraintResult)
|
|
443
|
+
? `Expected valid version constraint after @, got: ${constraint}`
|
|
444
|
+
: undefined;
|
|
445
|
+
};
|
|
428
446
|
export const ExtensionSpecSchema = Schema.NonEmptyString.pipe(Schema.check(Schema.makeFilter((value) => {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
const constraintAt = lastSlash > 0 ? value.indexOf("@", lastSlash + 1) : -1;
|
|
432
|
-
const fqnPart = constraintAt > 0 ? value.slice(0, constraintAt) : value;
|
|
433
|
-
const constraintPart = constraintAt > 0 ? value.slice(constraintAt + 1) : undefined;
|
|
434
|
-
// Validate FQN portion
|
|
435
|
-
if (parseExtensionFqnParts(fqnPart) === undefined) {
|
|
447
|
+
const { name, constraint } = splitExtensionReference(value);
|
|
448
|
+
if (parseExtensionFqnParts(name) === undefined) {
|
|
436
449
|
return `Expected extension spec in @handle/type/name[@constraint] form, got: ${value}`;
|
|
437
450
|
}
|
|
438
|
-
|
|
439
|
-
if (constraintPart !== undefined) {
|
|
440
|
-
const constraintResult = Schema.decodeUnknownResult(VersionRangeSchema)(constraintPart);
|
|
441
|
-
if (Result.isFailure(constraintResult)) {
|
|
442
|
-
return `Expected valid version constraint after @, got: ${constraintPart}`;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
return undefined;
|
|
451
|
+
return constraintIssue(constraint);
|
|
446
452
|
})), Schema.check(Schema.isPattern(EXTENSION_SPEC_PATTERN, {
|
|
447
453
|
message: "Expected extension spec in @handle/type/name[@constraint] form",
|
|
448
454
|
})), Schema.annotate({
|
|
@@ -460,20 +466,11 @@ export const ExtensionSpecSchema = Schema.NonEmptyString.pipe(Schema.check(Schem
|
|
|
460
466
|
* @experimental This API is unstable and may change without notice.
|
|
461
467
|
*/
|
|
462
468
|
export const PackSpecSchema = Schema.NonEmptyString.pipe(Schema.check(Schema.makeFilter((value) => {
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
const fqnPart = constraintAt > 0 ? value.slice(0, constraintAt) : value;
|
|
466
|
-
const constraintPart = constraintAt > 0 ? value.slice(constraintAt + 1) : undefined;
|
|
467
|
-
if (!PACK_FQN_PATTERN.test(fqnPart)) {
|
|
469
|
+
const { name, constraint } = splitExtensionReference(value);
|
|
470
|
+
if (!PACK_FQN_PATTERN.test(name)) {
|
|
468
471
|
return `Expected pack spec in @handle/packs/name[@constraint] form, got: ${value}`;
|
|
469
472
|
}
|
|
470
|
-
|
|
471
|
-
const constraintResult = Schema.decodeUnknownResult(VersionRangeSchema)(constraintPart);
|
|
472
|
-
if (Result.isFailure(constraintResult)) {
|
|
473
|
-
return `Expected valid version constraint after @, got: ${constraintPart}`;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
return undefined;
|
|
473
|
+
return constraintIssue(constraint);
|
|
477
474
|
})), Schema.check(Schema.isPattern(PACK_SPEC_PATTERN, {
|
|
478
475
|
message: "Expected pack spec in @handle/packs/name[@constraint] form",
|
|
479
476
|
})), Schema.annotate({
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
* @experimental This API is unstable and may change without notice.
|
|
10
10
|
*/
|
|
11
11
|
import * as Schema from "effect/Schema";
|
|
12
|
+
export declare const DeprecationReasons: readonly ["superseded", "obsolete", "unmaintained", "other"];
|
|
13
|
+
export declare const DeprecationReasonSchema: Schema.Literals<readonly ["superseded", "obsolete", "unmaintained", "other"]>;
|
|
14
|
+
export type DeprecationReason = typeof DeprecationReasonSchema.Type;
|
|
12
15
|
export declare const DeprecationReplacementSchema: Schema.Union<readonly [Schema.Struct<{
|
|
13
16
|
readonly status: Schema.Literal<"available">;
|
|
14
17
|
readonly fqn: Schema.String;
|
|
@@ -18,7 +21,24 @@ export declare const DeprecationReplacementSchema: Schema.Union<readonly [Schema
|
|
|
18
21
|
}>]>;
|
|
19
22
|
export declare const DeprecationViewSchema: Schema.Union<readonly [Schema.Struct<{
|
|
20
23
|
readonly deprecatedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
|
|
24
|
+
readonly reason: Schema.Literal<"superseded">;
|
|
25
|
+
readonly message: Schema.optional<Schema.String>;
|
|
26
|
+
readonly replacement: Schema.Union<readonly [Schema.Struct<{
|
|
27
|
+
readonly status: Schema.Literal<"available">;
|
|
28
|
+
readonly fqn: Schema.String;
|
|
29
|
+
}>, Schema.Struct<{
|
|
30
|
+
readonly status: Schema.Literal<"unavailable">;
|
|
31
|
+
readonly fqn: Schema.optional<Schema.String>;
|
|
32
|
+
}>]>;
|
|
33
|
+
}>, Schema.Struct<{
|
|
34
|
+
readonly deprecatedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
|
|
35
|
+
readonly reason: Schema.Literal<"obsolete">;
|
|
21
36
|
readonly message: Schema.String;
|
|
37
|
+
readonly replacement: Schema.optional<Schema.Never>;
|
|
38
|
+
}>, Schema.Struct<{
|
|
39
|
+
readonly deprecatedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
|
|
40
|
+
readonly reason: Schema.Literal<"unmaintained">;
|
|
41
|
+
readonly message: Schema.optional<Schema.String>;
|
|
22
42
|
readonly replacement: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
23
43
|
readonly status: Schema.Literal<"available">;
|
|
24
44
|
readonly fqn: Schema.String;
|
|
@@ -28,14 +48,15 @@ export declare const DeprecationViewSchema: Schema.Union<readonly [Schema.Struct
|
|
|
28
48
|
}>]>>;
|
|
29
49
|
}>, Schema.Struct<{
|
|
30
50
|
readonly deprecatedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
|
|
31
|
-
readonly
|
|
32
|
-
readonly
|
|
51
|
+
readonly reason: Schema.Literal<"other">;
|
|
52
|
+
readonly message: Schema.String;
|
|
53
|
+
readonly replacement: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
33
54
|
readonly status: Schema.Literal<"available">;
|
|
34
55
|
readonly fqn: Schema.String;
|
|
35
56
|
}>, Schema.Struct<{
|
|
36
57
|
readonly status: Schema.Literal<"unavailable">;
|
|
37
58
|
readonly fqn: Schema.optional<Schema.String>;
|
|
38
|
-
}>]
|
|
59
|
+
}>]>>;
|
|
39
60
|
}>]>;
|
|
40
61
|
export type DeprecationReplacement = typeof DeprecationReplacementSchema.Type;
|
|
41
62
|
export type DeprecationView = typeof DeprecationViewSchema.Type;
|
|
@@ -13,7 +13,12 @@ import { DateTimeUtcSchema } from "../date-time.js";
|
|
|
13
13
|
import { ExtensionFqnSchema } from "./common.js";
|
|
14
14
|
const DeprecationMessageSchema = Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(500)).annotate({
|
|
15
15
|
identifier: "DeprecationMessage",
|
|
16
|
-
description: "
|
|
16
|
+
description: "Optional publisher notes for consumers of a deprecated extension.",
|
|
17
|
+
});
|
|
18
|
+
export const DeprecationReasons = ["superseded", "obsolete", "unmaintained", "other"];
|
|
19
|
+
export const DeprecationReasonSchema = Schema.Literals(DeprecationReasons).annotate({
|
|
20
|
+
identifier: "DeprecationReason",
|
|
21
|
+
description: "The publisher's structured reason for deprecating an extension.",
|
|
17
22
|
});
|
|
18
23
|
export const DeprecationReplacementSchema = Schema.Union([
|
|
19
24
|
Schema.Struct({
|
|
@@ -31,13 +36,27 @@ export const DeprecationReplacementSchema = Schema.Union([
|
|
|
31
36
|
export const DeprecationViewSchema = Schema.Union([
|
|
32
37
|
Schema.Struct({
|
|
33
38
|
deprecatedAt: DateTimeUtcSchema,
|
|
39
|
+
reason: Schema.Literal("superseded"),
|
|
40
|
+
message: Schema.optional(DeprecationMessageSchema),
|
|
41
|
+
replacement: DeprecationReplacementSchema,
|
|
42
|
+
}),
|
|
43
|
+
Schema.Struct({
|
|
44
|
+
deprecatedAt: DateTimeUtcSchema,
|
|
45
|
+
reason: Schema.Literal("obsolete"),
|
|
34
46
|
message: DeprecationMessageSchema,
|
|
35
|
-
replacement: Schema.optional(
|
|
47
|
+
replacement: Schema.optional(Schema.Never),
|
|
36
48
|
}),
|
|
37
49
|
Schema.Struct({
|
|
38
50
|
deprecatedAt: DateTimeUtcSchema,
|
|
51
|
+
reason: Schema.Literal("unmaintained"),
|
|
39
52
|
message: Schema.optional(DeprecationMessageSchema),
|
|
40
|
-
replacement: DeprecationReplacementSchema,
|
|
53
|
+
replacement: Schema.optional(DeprecationReplacementSchema),
|
|
54
|
+
}),
|
|
55
|
+
Schema.Struct({
|
|
56
|
+
deprecatedAt: DateTimeUtcSchema,
|
|
57
|
+
reason: Schema.Literal("other"),
|
|
58
|
+
message: DeprecationMessageSchema,
|
|
59
|
+
replacement: Schema.optional(DeprecationReplacementSchema),
|
|
41
60
|
}),
|
|
42
61
|
]).annotate({
|
|
43
62
|
identifier: "DeprecationView",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @experimental This API is unstable and may change without notice.
|
|
5
5
|
*/
|
|
6
|
-
export { AgentIdSchema, type Author, AuthorSchema, CONTAINER_EXTENSION_TYPES, CommonManifestBaseFields, type ConfigurableAgentId, ConfigurableAgentIdSchema, type ContainerType, EXTENSION_NAME_PATTERN, INSTALLABLE_FROM_BY_TYPE, type ExtensionDependencyConstraintMap, ExtensionDependencyConstraintMapSchema, type ExtensionFqn, type ExtensionFqnParts, ExtensionFqnPartsSchema, ExtensionFqnSchema, type ExtensionName, ExtensionNameSchema, type ExtensionSpec, ExtensionSpecSchema, type ExtensionSourceFamily, type ExtensionType, type ExtensionTypePlural, ExtensionTypePluralSchema, ExtensionTypeSchema, type ExtensionVisibility, ExtensionVisibilitySchema, FQN_PATTERN, LicenseSchema, NON_PACK_FQN_PATTERN, type NonPackExtensionDependencyConstraintMap, NonPackExtensionDependencyConstraintMapSchema, type NonPackExtensionFqn, NonPackExtensionFqnSchema, type NonPackExtensionTypePlural, NonPackManifestFields, PACK_FQN_PATTERN, PER_AGENT_EXTENSION_TYPES, type PackFqn, PackFqnSchema, type PackMemberConstraint, PackMemberConstraintMapSchema, PackMemberConstraintSchema, type PackMemberConstraintMap, type PackMemberRegistrySource, PackMemberRegistrySourceSchema, packMemberRegistrySource, packMemberVersionRange, type PackSpec, PackSpecSchema, type PerAgentType, type PublishOptions, PublishOptionsSchema, type WorkspaceCapabilityType, decodeExtensionNameSync, extensionTypeFromPlural, extensionTypeLabels, extensionTypePluralLabels, extensionTypePluralSegments, extensionTypePluralSentenceLabels, extensionTypeSentenceLabels, extensionTypeToPlural, extensionTypes, extensionSourceFamilies, extensionTypesInstallableFrom, isInstallableFrom, isExtensionType, isExtensionTypePlural, nonPackExtensionTypePluralSegments, parseExtensionFqnParts, parseExtensionSpecParts, toAuthor, toExtensionType, toExtensionTypePlural, } from "./common.js";
|
|
6
|
+
export { AgentIdSchema, type Author, AuthorSchema, CONTAINER_EXTENSION_TYPES, CommonManifestBaseFields, type ConfigurableAgentId, ConfigurableAgentIdSchema, type ContainerType, EXTENSION_NAME_PATTERN, INSTALLABLE_FROM_BY_TYPE, type ExtensionDependencyConstraintMap, ExtensionDependencyConstraintMapSchema, type ExtensionFqn, type ExtensionFqnParts, ExtensionFqnPartsSchema, ExtensionFqnSchema, type ExtensionName, ExtensionNameSchema, type ExtensionSpec, ExtensionSpecSchema, type ExtensionSourceFamily, type ExtensionType, type ExtensionTypePlural, ExtensionTypePluralSchema, ExtensionTypeSchema, type ExtensionVisibility, ExtensionVisibilitySchema, FQN_PATTERN, LicenseSchema, NON_PACK_FQN_PATTERN, type NonPackExtensionDependencyConstraintMap, NonPackExtensionDependencyConstraintMapSchema, type NonPackExtensionFqn, NonPackExtensionFqnSchema, type NonPackExtensionTypePlural, NonPackManifestFields, PACK_FQN_PATTERN, PER_AGENT_EXTENSION_TYPES, type PackFqn, PackFqnSchema, type PackMemberConstraint, PackMemberConstraintMapSchema, PackMemberConstraintSchema, type PackMemberConstraintMap, type PackMemberRegistrySource, PackMemberRegistrySourceSchema, packMemberRegistrySource, packMemberVersionRange, type PackSpec, PackSpecSchema, type PerAgentType, type PublishOptions, PublishOptionsSchema, type WorkspaceCapabilityType, decodeExtensionNameSync, extensionTypeFromPlural, extensionTypeLabels, extensionTypePluralLabels, extensionTypePluralSegments, extensionTypePluralSentenceLabels, extensionTypeSentenceLabels, extensionTypeToPlural, extensionTypes, extensionSourceFamilies, extensionTypesInstallableFrom, isInstallableFrom, isExtensionType, isExtensionTypePlural, nonPackExtensionTypePluralSegments, parseExtensionFqnParts, parseExtensionSpecParts, splitExtensionReference, type SplitExtensionReference, toAuthor, toExtensionType, toExtensionTypePlural, } from "./common.js";
|
|
7
7
|
export { type ReleaseAgeExcludePattern, ReleaseAgeExcludePatternSchema, matchesReleaseAgeExcludePattern, } from "./fqn-pattern.js";
|
|
8
8
|
export { FqnInvalidError, formatFqn, parseFqn, parseFqnOrThrow } from "./fqn.js";
|
|
9
9
|
export { HANDLE_PATTERN, HANDLE_PATTERN_SOURCE, type Handle, HandleSchema, SLUG_PATTERN, SLUG_PATTERN_SOURCE, type Slug, SlugSchema, decodeHandleSync, decodeSlugSync, handleFromSlug, normalizeHandle, normalizeSlug, slugFromHandle, } from "./handle.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @experimental This API is unstable and may change without notice.
|
|
5
5
|
*/
|
|
6
|
-
export { AgentIdSchema, AuthorSchema, CONTAINER_EXTENSION_TYPES, CommonManifestBaseFields, ConfigurableAgentIdSchema, EXTENSION_NAME_PATTERN, INSTALLABLE_FROM_BY_TYPE, ExtensionDependencyConstraintMapSchema, ExtensionFqnPartsSchema, ExtensionFqnSchema, ExtensionNameSchema, ExtensionSpecSchema, ExtensionTypePluralSchema, ExtensionTypeSchema, ExtensionVisibilitySchema, FQN_PATTERN, LicenseSchema, NON_PACK_FQN_PATTERN, NonPackExtensionDependencyConstraintMapSchema, NonPackExtensionFqnSchema, NonPackManifestFields, PACK_FQN_PATTERN, PER_AGENT_EXTENSION_TYPES, PackFqnSchema, PackMemberConstraintMapSchema, PackMemberConstraintSchema, PackMemberRegistrySourceSchema, packMemberRegistrySource, packMemberVersionRange, PackSpecSchema, PublishOptionsSchema, decodeExtensionNameSync, extensionTypeFromPlural, extensionTypeLabels, extensionTypePluralLabels, extensionTypePluralSegments, extensionTypePluralSentenceLabels, extensionTypeSentenceLabels, extensionTypeToPlural, extensionTypes, extensionSourceFamilies, extensionTypesInstallableFrom, isInstallableFrom, isExtensionType, isExtensionTypePlural, nonPackExtensionTypePluralSegments, parseExtensionFqnParts, parseExtensionSpecParts, toAuthor, toExtensionType, toExtensionTypePlural, } from "./common.js";
|
|
6
|
+
export { AgentIdSchema, AuthorSchema, CONTAINER_EXTENSION_TYPES, CommonManifestBaseFields, ConfigurableAgentIdSchema, EXTENSION_NAME_PATTERN, INSTALLABLE_FROM_BY_TYPE, ExtensionDependencyConstraintMapSchema, ExtensionFqnPartsSchema, ExtensionFqnSchema, ExtensionNameSchema, ExtensionSpecSchema, ExtensionTypePluralSchema, ExtensionTypeSchema, ExtensionVisibilitySchema, FQN_PATTERN, LicenseSchema, NON_PACK_FQN_PATTERN, NonPackExtensionDependencyConstraintMapSchema, NonPackExtensionFqnSchema, NonPackManifestFields, PACK_FQN_PATTERN, PER_AGENT_EXTENSION_TYPES, PackFqnSchema, PackMemberConstraintMapSchema, PackMemberConstraintSchema, PackMemberRegistrySourceSchema, packMemberRegistrySource, packMemberVersionRange, PackSpecSchema, PublishOptionsSchema, decodeExtensionNameSync, extensionTypeFromPlural, extensionTypeLabels, extensionTypePluralLabels, extensionTypePluralSegments, extensionTypePluralSentenceLabels, extensionTypeSentenceLabels, extensionTypeToPlural, extensionTypes, extensionSourceFamilies, extensionTypesInstallableFrom, isInstallableFrom, isExtensionType, isExtensionTypePlural, nonPackExtensionTypePluralSegments, parseExtensionFqnParts, parseExtensionSpecParts, splitExtensionReference, toAuthor, toExtensionType, toExtensionTypePlural, } from "./common.js";
|
|
7
7
|
export { ReleaseAgeExcludePatternSchema, matchesReleaseAgeExcludePattern, } from "./fqn-pattern.js";
|
|
8
8
|
export { FqnInvalidError, formatFqn, parseFqn, parseFqnOrThrow } from "./fqn.js";
|
|
9
9
|
export { HANDLE_PATTERN, HANDLE_PATTERN_SOURCE, HandleSchema, SLUG_PATTERN, SLUG_PATTERN_SOURCE, SlugSchema, decodeHandleSync, decodeSlugSync, handleFromSlug, normalizeHandle, normalizeSlug, slugFromHandle, } from "./handle.js";
|
|
@@ -7,15 +7,17 @@
|
|
|
7
7
|
* @experimental This API is unstable and may change without notice.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Match one extension name against a pattern.
|
|
11
11
|
*
|
|
12
12
|
* Only `*` wildcards are supported. All other characters (including `?`, `[`, `]`)
|
|
13
13
|
* are treated as literals. Matching is case-sensitive.
|
|
14
14
|
*
|
|
15
15
|
* @param pattern - The pattern to match (may contain `*`)
|
|
16
|
-
* @param
|
|
17
|
-
* @returns
|
|
16
|
+
* @param name - The name to check
|
|
17
|
+
* @returns Whether the complete name matches
|
|
18
18
|
*/
|
|
19
|
+
export declare const matchesPattern: (pattern: string, name: string) => boolean;
|
|
20
|
+
/** Expand a glob pattern against names, preserving their original order. */
|
|
19
21
|
export declare const expandGlob: (pattern: string, names: ReadonlyArray<string>) => ReadonlyArray<string>;
|
|
20
22
|
/**
|
|
21
23
|
* Expand multiple glob patterns against a list of extension names.
|
|
@@ -7,48 +7,47 @@
|
|
|
7
7
|
* @experimental This API is unstable and may change without notice.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Match one extension name against a pattern.
|
|
11
11
|
*
|
|
12
12
|
* Only `*` wildcards are supported. All other characters (including `?`, `[`, `]`)
|
|
13
13
|
* are treated as literals. Matching is case-sensitive.
|
|
14
14
|
*
|
|
15
15
|
* @param pattern - The pattern to match (may contain `*`)
|
|
16
|
-
* @param
|
|
17
|
-
* @returns
|
|
16
|
+
* @param name - The name to check
|
|
17
|
+
* @returns Whether the complete name matches
|
|
18
18
|
*/
|
|
19
|
-
export const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
}
|
|
19
|
+
export const matchesPattern = (pattern, name) => {
|
|
20
|
+
let patternIndex = 0;
|
|
21
|
+
let nameIndex = 0;
|
|
22
|
+
let wildcardIndex = -1;
|
|
23
|
+
let wildcardNameIndex = 0;
|
|
24
|
+
while (nameIndex < name.length) {
|
|
25
|
+
const token = pattern[patternIndex];
|
|
26
|
+
if (token !== undefined && token !== "*" && token === name[nameIndex]) {
|
|
27
|
+
patternIndex += 1;
|
|
28
|
+
nameIndex += 1;
|
|
44
29
|
}
|
|
45
|
-
|
|
30
|
+
else if (token === "*") {
|
|
31
|
+
wildcardIndex = patternIndex;
|
|
32
|
+
wildcardNameIndex = nameIndex;
|
|
46
33
|
patternIndex += 1;
|
|
47
34
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
else if (wildcardIndex >= 0) {
|
|
36
|
+
patternIndex = wildcardIndex + 1;
|
|
37
|
+
wildcardNameIndex += 1;
|
|
38
|
+
nameIndex = wildcardNameIndex;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
while (pattern[patternIndex] === "*") {
|
|
45
|
+
patternIndex += 1;
|
|
46
|
+
}
|
|
47
|
+
return patternIndex === pattern.length;
|
|
51
48
|
};
|
|
49
|
+
/** Expand a glob pattern against names, preserving their original order. */
|
|
50
|
+
export const expandGlob = (pattern, names) => names.filter((name) => matchesPattern(pattern, name));
|
|
52
51
|
/**
|
|
53
52
|
* Expand multiple glob patterns against a list of extension names.
|
|
54
53
|
*
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @experimental This API is unstable and may change without notice.
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
*/
|
|
11
|
+
import type { ExtensionName } from "../common.js";
|
|
11
12
|
import type { SkillExtensionRef } from "./skill.js";
|
|
12
13
|
import type { McpServerExtensionRef } from "./mcp-server.js";
|
|
13
14
|
import type { SubagentExtensionRef } from "./subagent.js";
|
|
@@ -17,4 +18,12 @@ import type { KnowledgeExtensionRef } from "./knowledge.js";
|
|
|
17
18
|
import type { PackRef } from "./pack.js";
|
|
18
19
|
/** @experimental */
|
|
19
20
|
export type ExtensionRef = SkillExtensionRef | McpServerExtensionRef | SubagentExtensionRef | RuleExtensionRef | HookExtensionRef | KnowledgeExtensionRef | PackRef;
|
|
21
|
+
/**
|
|
22
|
+
* The name an extension's own manifest gives it: the configured workspace
|
|
23
|
+
* name it occupies. A Registry ref's `name` is the package the Registry
|
|
24
|
+
* serves it under and may differ; Registry operations use that one.
|
|
25
|
+
*
|
|
26
|
+
* @experimental
|
|
27
|
+
*/
|
|
28
|
+
export declare const extensionRefName: (ref: ExtensionRef) => ExtensionName;
|
|
20
29
|
//# sourceMappingURL=extension-ref.d.ts.map
|
|
@@ -8,5 +8,29 @@
|
|
|
8
8
|
* @experimental This API is unstable and may change without notice.
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The name an extension's own manifest gives it: the configured workspace
|
|
13
|
+
* name it occupies. A Registry ref's `name` is the package the Registry
|
|
14
|
+
* serves it under and may differ; Registry operations use that one.
|
|
15
|
+
*
|
|
16
|
+
* @experimental
|
|
17
|
+
*/
|
|
18
|
+
export const extensionRefName = (ref) => {
|
|
19
|
+
switch (ref.type) {
|
|
20
|
+
case "skill":
|
|
21
|
+
return ref.skill.name;
|
|
22
|
+
case "mcp-server":
|
|
23
|
+
return ref.server.name;
|
|
24
|
+
case "pack":
|
|
25
|
+
return ref.pack.name;
|
|
26
|
+
case "subagent":
|
|
27
|
+
return ref.subagent.name;
|
|
28
|
+
case "rule":
|
|
29
|
+
return ref.rule.name;
|
|
30
|
+
case "hook":
|
|
31
|
+
return ref.hook.name;
|
|
32
|
+
case "knowledge":
|
|
33
|
+
return ref.knowledge.name;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
12
36
|
//# sourceMappingURL=extension-ref.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as Option from "effect/Option";
|
|
1
2
|
import * as Schema from "effect/Schema";
|
|
2
3
|
export declare const RegistrySourcePatternPartsSchema: Schema.Struct<{
|
|
3
4
|
readonly owner: Schema.brand<Schema.String, "Handle">;
|
|
@@ -6,8 +7,14 @@ export declare const RegistrySourcePatternPartsSchema: Schema.Struct<{
|
|
|
6
7
|
readonly versionRange: Schema.optional<Schema.brand<Schema.NonEmptyString, "VersionRange">>;
|
|
7
8
|
}>;
|
|
8
9
|
export type RegistrySourcePatternParts = Schema.Schema.Type<typeof RegistrySourcePatternPartsSchema>;
|
|
10
|
+
/**
|
|
11
|
+
* A Registry locator with the configured source it names, when it names one.
|
|
12
|
+
* An unqualified `@owner/...` locator names no source here: which configured
|
|
13
|
+
* Registry it binds to is a workspace decision, made beside the settings that
|
|
14
|
+
* hold the effective default Registry.
|
|
15
|
+
*/
|
|
9
16
|
export type SourceQualifiedRegistrySourcePatternParts = RegistrySourcePatternParts & {
|
|
10
|
-
readonly sourceName: string
|
|
17
|
+
readonly sourceName: Option.Option<string>;
|
|
11
18
|
};
|
|
12
19
|
export declare const RegistrySourceRefPartsSchema: Schema.Struct<{
|
|
13
20
|
readonly owner: Schema.brand<Schema.String, "Handle">;
|
|
@@ -17,7 +24,10 @@ export declare const RegistrySourceRefPartsSchema: Schema.Struct<{
|
|
|
17
24
|
}>;
|
|
18
25
|
export type RegistrySourceRefParts = Schema.Schema.Type<typeof RegistrySourceRefPartsSchema>;
|
|
19
26
|
export declare const parseRegistrySourcePatternParts: (input: string) => RegistrySourcePatternParts | undefined;
|
|
20
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Parse a Registry locator, keeping the configured source name it spells
|
|
29
|
+
* (`<source>:@owner/...`) and leaving an unqualified locator unbound.
|
|
30
|
+
*/
|
|
21
31
|
export declare const parseSourceQualifiedRegistrySourcePatternParts: (input: string) => SourceQualifiedRegistrySourcePatternParts | undefined;
|
|
22
32
|
export declare const parseRegistrySourceRef: (input: string) => RegistrySourceRefParts | undefined;
|
|
23
33
|
export declare const formatRegistrySourcePatternParts: (value: RegistrySourcePatternParts) => string;
|