@a16njs/models 0.1.0 → 0.2.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { CustomizationType, type AgentCustomization, type GlobalPrompt, type AgentSkill, type FileRule, type AgentIgnore, type AgentCommand, } from './types.js';
2
- export { type A16nPlugin, type DiscoveryResult, type EmitResult, type WrittenFile, } from './plugin.js';
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
4
  export { isGlobalPrompt, isAgentSkill, isFileRule, isAgentIgnore, isAgentCommand, getUniqueFilename, createId, } from './helpers.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,EACL,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,QAAQ,GACT,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,EACL,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,QAAQ,GACT,MAAM,cAAc,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,QAAQ;AACR,OAAO,EACL,iBAAiB,GAOlB,MAAM,YAAY,CAAC;AAUpB,WAAW;AACX,OAAO,EAAE,WAAW,EAAgB,MAAM,eAAe,CAAC;AAE1D,UAAU;AACV,OAAO,EACL,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,QAAQ,GACT,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,QAAQ;AACR,OAAO,EACL,iBAAiB,GAOlB,MAAM,YAAY,CAAC;AAWpB,WAAW;AACX,OAAO,EAAE,WAAW,EAAgB,MAAM,eAAe,CAAC;AAE1D,UAAU;AACV,OAAO,EACL,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,QAAQ,GACT,MAAM,cAAc,CAAC"}
package/dist/plugin.d.ts CHANGED
@@ -19,18 +19,33 @@ export interface WrittenFile {
19
19
  type: CustomizationType;
20
20
  /** How many models went into this file (1 for 1:1, more if merged) */
21
21
  itemCount: number;
22
+ /** True if this file was created fresh; false if merged/edited existing */
23
+ isNewFile: boolean;
24
+ /**
25
+ * Which source AgentCustomizations contributed to this output file.
26
+ * Optional for backwards compatibility.
27
+ * Enables accurate git-ignore conflict detection in match mode.
28
+ */
29
+ sourceItems?: AgentCustomization[];
22
30
  }
23
31
  /**
24
32
  * Result of emitting customizations to a project.
25
33
  */
26
34
  export interface EmitResult {
27
- /** Files that were written */
35
+ /** Files that were written (or would be written in dry-run) */
28
36
  written: WrittenFile[];
29
37
  /** Any warnings encountered during emission */
30
38
  warnings: Warning[];
31
39
  /** Items that could not be represented by this plugin */
32
40
  unsupported: AgentCustomization[];
33
41
  }
42
+ /**
43
+ * Options for emitting customizations.
44
+ */
45
+ export interface EmitOptions {
46
+ /** If true, calculate what would be written without actually writing */
47
+ dryRun?: boolean;
48
+ }
34
49
  /**
35
50
  * The plugin interface that all a16n plugins must implement.
36
51
  * Plugins bridge between a16n's internal model and a specific tool's format.
@@ -52,8 +67,9 @@ export interface A16nPlugin {
52
67
  * Emit customization models to disk in this plugin's format.
53
68
  * @param models - The customizations to emit
54
69
  * @param root - The root directory to write to
55
- * @returns Info about what was written and any issues
70
+ * @param options - Optional emit options (e.g., dryRun)
71
+ * @returns Info about what was written (or would be written) and any issues
56
72
  */
57
- emit(models: AgentCustomization[], root: string): Promise<EmitResult>;
73
+ emit(models: AgentCustomization[], root: string, options?: EmitOptions): Promise<EmitResult>;
58
74
  }
59
75
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oCAAoC;IACpC,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,gDAAgD;IAChD,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MA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B,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,SAAS,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,+DAA+D;IAC/D,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,+CAA+C;IAC/C,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,yDAAyD;IACzD,WAAW,EAAE,kBAAkB,EAAE,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,wEAAwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,2DAA2D;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAE9B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAEjD;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,EAAE,kBAAkB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAC9F"}
@@ -11,7 +11,11 @@ export declare enum WarningCode {
11
11
  /** Existing file was replaced */
12
12
  Overwritten = "overwritten",
13
13
  /** File was renamed to avoid collision */
14
- FileRenamed = "file-renamed"
14
+ FileRenamed = "file-renamed",
15
+ /** Git-ignored source with tracked output (or vice versa) */
16
+ BoundaryCrossing = "boundary-crossing",
17
+ /** Sources have conflicting git status (some ignored, some tracked) */
18
+ GitStatusConflict = "git-status-conflict"
15
19
  }
16
20
  /**
17
21
  * A warning about something that happened during conversion.
@@ -1 +1 @@
1
- {"version":3,"file":"warnings.d.ts","sourceRoot":"","sources":["../src/warnings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,WAAW;IACrB,kDAAkD;IAClD,MAAM,WAAW;IACjB,yCAAyC;IACzC,YAAY,iBAAiB;IAC7B,4CAA4C;IAC5C,OAAO,YAAY;IACnB,iCAAiC;IACjC,WAAW,gBAAgB;IAC3B,0CAA0C;IAC1C,WAAW,iBAAiB;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,0BAA0B;IAC1B,IAAI,EAAE,WAAW,CAAC;IAClB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"}
1
+ {"version":3,"file":"warnings.d.ts","sourceRoot":"","sources":["../src/warnings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,WAAW;IACrB,kDAAkD;IAClD,MAAM,WAAW;IACjB,yCAAyC;IACzC,YAAY,iBAAiB;IAC7B,4CAA4C;IAC5C,OAAO,YAAY;IACnB,iCAAiC;IACjC,WAAW,gBAAgB;IAC3B,0CAA0C;IAC1C,WAAW,iBAAiB;IAC5B,6DAA6D;IAC7D,gBAAgB,sBAAsB;IACtC,uEAAuE;IACvE,iBAAiB,wBAAwB;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,0BAA0B;IAC1B,IAAI,EAAE,WAAW,CAAC;IAClB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"}
package/dist/warnings.js CHANGED
@@ -13,5 +13,9 @@ export var WarningCode;
13
13
  WarningCode["Overwritten"] = "overwritten";
14
14
  /** File was renamed to avoid collision */
15
15
  WarningCode["FileRenamed"] = "file-renamed";
16
+ /** Git-ignored source with tracked output (or vice versa) */
17
+ WarningCode["BoundaryCrossing"] = "boundary-crossing";
18
+ /** Sources have conflicting git status (some ignored, some tracked) */
19
+ WarningCode["GitStatusConflict"] = "git-status-conflict";
16
20
  })(WarningCode || (WarningCode = {}));
17
21
  //# sourceMappingURL=warnings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"warnings.js","sourceRoot":"","sources":["../src/warnings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,WAWX;AAXD,WAAY,WAAW;IACrB,kDAAkD;IAClD,gCAAiB,CAAA;IACjB,yCAAyC;IACzC,4CAA6B,CAAA;IAC7B,4CAA4C;IAC5C,kCAAmB,CAAA;IACnB,iCAAiC;IACjC,0CAA2B,CAAA;IAC3B,0CAA0C;IAC1C,2CAA4B,CAAA;AAC9B,CAAC,EAXW,WAAW,KAAX,WAAW,QAWtB"}
1
+ {"version":3,"file":"warnings.js","sourceRoot":"","sources":["../src/warnings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,WAeX;AAfD,WAAY,WAAW;IACrB,kDAAkD;IAClD,gCAAiB,CAAA;IACjB,yCAAyC;IACzC,4CAA6B,CAAA;IAC7B,4CAA4C;IAC5C,kCAAmB,CAAA;IACnB,iCAAiC;IACjC,0CAA2B,CAAA;IAC3B,0CAA0C;IAC1C,2CAA4B,CAAA;IAC5B,6DAA6D;IAC7D,qDAAsC,CAAA;IACtC,uEAAuE;IACvE,wDAAyC,CAAA;AAC3C,CAAC,EAfW,WAAW,KAAX,WAAW,QAetB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a16njs/models",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Type definitions and plugin interface for a16n",
5
5
  "license": "AGPL-3.0",
6
6
  "author": "Texarkanine",