@a16njs/models 0.2.0 → 0.3.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/README.md +6 -4
- package/dist/helpers.d.ts +3 -3
- package/dist/helpers.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/types.d.ts +9 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,12 +25,13 @@ import {
|
|
|
25
25
|
|
|
26
26
|
### Types
|
|
27
27
|
|
|
28
|
-
- `CustomizationType` - Enum of customization types (GlobalPrompt, AgentSkill, FileRule, AgentIgnore)
|
|
28
|
+
- `CustomizationType` - Enum of customization types (GlobalPrompt, AgentSkill, FileRule, AgentIgnore, ManualPrompt)
|
|
29
29
|
- `AgentCustomization` - Base interface for all customizations
|
|
30
30
|
- `GlobalPrompt` - Always-applied prompts
|
|
31
|
-
- `AgentSkill` - Context-triggered by description
|
|
32
|
-
- `FileRule` - Triggered by file patterns
|
|
33
|
-
- `AgentIgnore` - Ignore patterns
|
|
31
|
+
- `AgentSkill` - Context-triggered by description
|
|
32
|
+
- `FileRule` - Triggered by file patterns
|
|
33
|
+
- `AgentIgnore` - Ignore patterns
|
|
34
|
+
- `ManualPrompt` - User-invoked prompts (e.g., `/command`), stored in `.cursor/skills/` or `.claude/skills/` with `disable-model-invocation: true`
|
|
34
35
|
|
|
35
36
|
### Plugin Interface
|
|
36
37
|
|
|
@@ -50,4 +51,5 @@ import {
|
|
|
50
51
|
- `isAgentSkill(item)` - Type guard for AgentSkill
|
|
51
52
|
- `isFileRule(item)` - Type guard for FileRule
|
|
52
53
|
- `isAgentIgnore(item)` - Type guard for AgentIgnore
|
|
54
|
+
- `isManualPrompt(item)` - Type guard for ManualPrompt
|
|
53
55
|
- `createId(type, sourcePath)` - Create unique ID
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AgentCustomization, type GlobalPrompt, type AgentSkill, type FileRule, type AgentIgnore, type
|
|
1
|
+
import { type AgentCustomization, type GlobalPrompt, type AgentSkill, type FileRule, type AgentIgnore, type ManualPrompt, CustomizationType } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Type guard to check if an item is a GlobalPrompt.
|
|
4
4
|
*/
|
|
@@ -16,9 +16,9 @@ export declare function isFileRule(item: AgentCustomization): item is FileRule;
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function isAgentIgnore(item: AgentCustomization): item is AgentIgnore;
|
|
18
18
|
/**
|
|
19
|
-
* Type guard to check if an item is
|
|
19
|
+
* Type guard to check if an item is a ManualPrompt.
|
|
20
20
|
*/
|
|
21
|
-
export declare function
|
|
21
|
+
export declare function isManualPrompt(item: AgentCustomization): item is ManualPrompt;
|
|
22
22
|
/**
|
|
23
23
|
* Get a unique filename by appending a counter if the name already exists.
|
|
24
24
|
* @param baseName - The base name to start with
|
package/dist/helpers.js
CHANGED
|
@@ -24,10 +24,10 @@ export function isAgentIgnore(item) {
|
|
|
24
24
|
return item.type === CustomizationType.AgentIgnore;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* Type guard to check if an item is
|
|
27
|
+
* Type guard to check if an item is a ManualPrompt.
|
|
28
28
|
*/
|
|
29
|
-
export function
|
|
30
|
-
return item.type === CustomizationType.
|
|
29
|
+
export function isManualPrompt(item) {
|
|
30
|
+
return item.type === CustomizationType.ManualPrompt;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Get a unique filename by appending a counter if the name already exists.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CustomizationType, type AgentCustomization, type GlobalPrompt, type AgentSkill, type FileRule, type AgentIgnore, type
|
|
1
|
+
export { CustomizationType, type AgentCustomization, type GlobalPrompt, type AgentSkill, type FileRule, type AgentIgnore, type ManualPrompt, } from './types.js';
|
|
2
2
|
export { type A16nPlugin, type DiscoveryResult, type EmitResult, type EmitOptions, type WrittenFile, } from './plugin.js';
|
|
3
3
|
export { WarningCode, type Warning } from './warnings.js';
|
|
4
|
-
export { isGlobalPrompt, isAgentSkill, isFileRule, isAgentIgnore,
|
|
4
|
+
export { isGlobalPrompt, isAgentSkill, isFileRule, isAgentIgnore, isManualPrompt, getUniqueFilename, createId, } from './helpers.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -4,5 +4,5 @@ export { CustomizationType, } from './types.js';
|
|
|
4
4
|
// Warnings
|
|
5
5
|
export { WarningCode } from './warnings.js';
|
|
6
6
|
// Helpers
|
|
7
|
-
export { isGlobalPrompt, isAgentSkill, isFileRule, isAgentIgnore,
|
|
7
|
+
export { isGlobalPrompt, isAgentSkill, isFileRule, isAgentIgnore, isManualPrompt, getUniqueFilename, createId, } from './helpers.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/types.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ export declare enum CustomizationType {
|
|
|
11
11
|
FileRule = "file-rule",
|
|
12
12
|
/** Files/patterns to exclude from agent context */
|
|
13
13
|
AgentIgnore = "agent-ignore",
|
|
14
|
-
/** Explicitly invoked slash commands */
|
|
15
|
-
|
|
14
|
+
/** Explicitly invoked prompts (slash commands, skills with disable-model-invocation) */
|
|
15
|
+
ManualPrompt = "manual-prompt"
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Base interface for all agent customization items.
|
|
@@ -65,15 +65,14 @@ export interface AgentIgnore extends AgentCustomization {
|
|
|
65
65
|
patterns: string[];
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
69
|
-
* Examples: Cursor commands in .cursor/commands
|
|
68
|
+
* A manually-invoked prompt (slash command or skill with disable-model-invocation).
|
|
69
|
+
* Examples: Cursor commands in .cursor/commands/, skills with disable-model-invocation: true
|
|
70
70
|
*
|
|
71
|
-
*
|
|
72
|
-
* Commands with special features ($ARGUMENTS, !, @, allowed-tools) are skipped.
|
|
71
|
+
* These prompts are only activated when explicitly invoked by the user.
|
|
73
72
|
*/
|
|
74
|
-
export interface
|
|
75
|
-
type: CustomizationType.
|
|
76
|
-
/**
|
|
77
|
-
|
|
73
|
+
export interface ManualPrompt extends AgentCustomization {
|
|
74
|
+
type: CustomizationType.ManualPrompt;
|
|
75
|
+
/** Prompt name for invocation (e.g., "review" for /review) */
|
|
76
|
+
promptName: string;
|
|
78
77
|
}
|
|
79
78
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B,4DAA4D;IAC5D,YAAY,kBAAkB;IAC9B,gDAAgD;IAChD,UAAU,gBAAgB;IAC1B,sCAAsC;IACtC,QAAQ,cAAc;IACtB,mDAAmD;IACnD,WAAW,iBAAiB;IAC5B,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B,4DAA4D;IAC5D,YAAY,kBAAkB;IAC9B,gDAAgD;IAChD,UAAU,gBAAgB;IAC1B,sCAAsC;IACtC,QAAQ,cAAc;IACtB,mDAAmD;IACnD,WAAW,iBAAiB;IAC5B,wFAAwF;IACxF,YAAY,kBAAkB;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,IAAI,EAAE,iBAAiB,CAAC;IACxB,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,kBAAkB;IACtD,IAAI,EAAE,iBAAiB,CAAC,YAAY,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IACpD,IAAI,EAAE,iBAAiB,CAAC,UAAU,CAAC;IACnC,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,QAAS,SAAQ,kBAAkB;IAClD,IAAI,EAAE,iBAAiB,CAAC,QAAQ,CAAC;IACjC,2CAA2C;IAC3C,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD,IAAI,EAAE,iBAAiB,CAAC,WAAW,CAAC;IACpC,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,kBAAkB;IACtD,IAAI,EAAE,iBAAiB,CAAC,YAAY,CAAC;IACrC,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
package/dist/types.js
CHANGED
|
@@ -12,7 +12,7 @@ export var CustomizationType;
|
|
|
12
12
|
CustomizationType["FileRule"] = "file-rule";
|
|
13
13
|
/** Files/patterns to exclude from agent context */
|
|
14
14
|
CustomizationType["AgentIgnore"] = "agent-ignore";
|
|
15
|
-
/** Explicitly invoked slash commands */
|
|
16
|
-
CustomizationType["
|
|
15
|
+
/** Explicitly invoked prompts (slash commands, skills with disable-model-invocation) */
|
|
16
|
+
CustomizationType["ManualPrompt"] = "manual-prompt";
|
|
17
17
|
})(CustomizationType || (CustomizationType = {}));
|
|
18
18
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAWX;AAXD,WAAY,iBAAiB;IAC3B,4DAA4D;IAC5D,mDAA8B,CAAA;IAC9B,gDAAgD;IAChD,+CAA0B,CAAA;IAC1B,sCAAsC;IACtC,2CAAsB,CAAA;IACtB,mDAAmD;IACnD,iDAA4B,CAAA;IAC5B,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAWX;AAXD,WAAY,iBAAiB;IAC3B,4DAA4D;IAC5D,mDAA8B,CAAA;IAC9B,gDAAgD;IAChD,+CAA0B,CAAA;IAC1B,sCAAsC;IACtC,2CAAsB,CAAA;IACtB,mDAAmD;IACnD,iDAA4B,CAAA;IAC5B,wFAAwF;IACxF,mDAA8B,CAAA;AAChC,CAAC,EAXW,iBAAiB,KAAjB,iBAAiB,QAW5B"}
|