@pulsemcp/air-core 0.0.41 → 0.1.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 CHANGED
@@ -24,8 +24,8 @@ const artifacts = await resolveArtifacts("~/.air/air.json");
24
24
  // Validate a JSON file against its AIR schema
25
25
  const result = validateJson(data, "skills");
26
26
 
27
- // Merge two artifact sets (later wins for matching IDs)
28
- const merged = mergeArtifacts(base, override);
27
+ // Merge two artifact sets (additive union duplicate qualified IDs throw)
28
+ const merged = mergeArtifacts(base, overlay);
29
29
  ```
30
30
 
31
31
  ### With a Catalog Provider (remote URIs)
package/dist/config.d.ts CHANGED
@@ -18,6 +18,11 @@ export interface ResolveOptions {
18
18
  * (e.g., `gitProtocol`). Providers ignore unknown keys.
19
19
  */
20
20
  providerOptions?: Record<string, unknown>;
21
+ /**
22
+ * Sink for non-fatal warnings (e.g. cross-scope shortname collisions, stale
23
+ * `exclude` entries). When omitted, core writes warnings to `console.warn`.
24
+ */
25
+ onWarning?: (message: string) => void;
21
26
  }
22
27
  /**
23
28
  * Merge air.json-level provider fields with runtime overrides and dispatch
@@ -34,24 +39,40 @@ export interface ResolveOptions {
34
39
  export declare function configureProviders(providers: CatalogProvider[], airConfig: AirConfig, providerOptions?: Record<string, unknown>): void;
35
40
  /**
36
41
  * Resolve all artifacts from an air.json file.
37
- * Each artifact property is an array of paths; files merge in order.
38
- * Remote URIs are delegated to the matching CatalogProvider.
39
42
  *
40
- * `catalogs` entries are expanded first into per-type paths following the
41
- * standard layout (`<catalog>/<type>/<type>.json`), then the explicit
42
- * per-type arrays layer on top. Missing files within a catalog are
43
- * silently skipped.
43
+ * Every artifact is canonically `@scope/id`:
44
+ * - Catalog providers supply scope via `getScope(uri)` (e.g. the GitHub
45
+ * provider returns `owner/repo`).
46
+ * - Local catalogs and per-type arrays default to scope `local`.
47
+ *
48
+ * Composition is union-only: catalogs and per-type arrays *contribute*
49
+ * artifacts. The only way to remove an artifact is via `air.json#exclude`,
50
+ * which lists qualified IDs to drop from the resolved set. Two contributors
51
+ * producing the same qualified ID hard-fail; same shortname under different
52
+ * scopes warns and both qualified IDs appear in the result.
44
53
  *
45
- * All `path` fields in resolved entries are absolute paths,
46
- * making artifacts self-contained regardless of source location.
54
+ * Reference fields inside artifact bodies (skill.references, plugin.skills,
55
+ * root.default_skills, …) are canonicalized to qualified IDs at resolution
56
+ * time. References inside a catalog's own indexes resolve to that catalog's
57
+ * scope first; cross-catalog references must use the qualified form when
58
+ * the shortname is ambiguous.
59
+ *
60
+ * All `path` fields are absolute, making artifacts self-contained regardless
61
+ * of source location.
47
62
  */
48
63
  export declare function resolveArtifacts(airJsonPath: string, options?: ResolveOptions): Promise<ResolvedArtifacts>;
49
64
  /**
50
- * Merge two resolved artifact sets. Override wins for matching IDs.
51
- * Composite plugins are re-expanded after merging so that newly
52
- * added plugins that reference existing ones are fully resolved.
65
+ * Combine two resolved artifact sets by union. Inputs must already be
66
+ * qualified (`@scope/id`); a duplicate qualified ID across the two inputs
67
+ * is rejected with a clear diagnostic. Composite plugins are re-expanded
68
+ * after merging.
69
+ *
70
+ * `mergeArtifacts` is a low-level helper used to layer two pre-resolved
71
+ * sets — for example, an external orchestrator merging a parent session's
72
+ * artifacts with a subagent's. Most callers should compose at the air.json
73
+ * level (catalogs + exclude) instead.
53
74
  */
54
- export declare function mergeArtifacts(base: ResolvedArtifacts, override: ResolvedArtifacts): ResolvedArtifacts;
75
+ export declare function mergeArtifacts(base: ResolvedArtifacts, overlay: ResolvedArtifacts): ResolvedArtifacts;
55
76
  /**
56
77
  * Recursively expand plugin references.
57
78
  *
@@ -62,12 +83,12 @@ export declare function mergeArtifacts(base: ResolvedArtifacts, override: Resolv
62
83
  * not a runtime concept.
63
84
  *
64
85
  * Semantics:
65
- * - Child plugins are expanded depth-first in declaration order
66
- * - Parent's direct declarations override children (later wins via dedup)
67
- * - Circular references are rejected with a clear error message
68
- * - Plugins without a `plugins` field are returned unchanged
69
- * - The `plugins` array on each entry is preserved as metadata (e.g., for
70
- * UI display of the dependency graph) even though primitives are inlined
86
+ * - All IDs are already qualified (`@scope/id`) at this stage.
87
+ * - Child plugins are expanded depth-first in declaration order.
88
+ * - Parent's direct declarations come last (later wins via dedup).
89
+ * - Circular references are rejected with a clear error message.
90
+ * - Plugins without a `plugins` field are returned unchanged.
91
+ * - The `plugins` array on each entry is preserved as metadata.
71
92
  *
72
93
  * Returns a new ResolvedArtifacts object; the input is not mutated.
73
94
  */
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,SAAS,EACT,iBAAiB,EAOjB,eAAe,EAChB,MAAM,YAAY,CAAC;AA+FpB,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAG5D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAM9C;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAG9C;AAED,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAC9B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,eAAe,EAAE,EAC5B,SAAS,EAAE,SAAS,EACpB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACxC,IAAI,CAwBN;AAmFD;;;;;;;;;;;;GAYG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,iBAAiB,CAAC,CAsD5B;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,iBAAiB,EACvB,QAAQ,EAAE,iBAAi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