aiwg
Version:
Deployment tool and support utility for AI context. Copies agents, skills, commands, rules, and behaviors into the paths each AI platform reads (Claude Code, Codex, Copilot, Cursor, Warp, OpenClaw, and 6 more) so one source of truth works across 10 platfo
46 lines • 2.15 kB
TypeScript
/**
* Upstream Artifact Registry
*
* Scans the framework root for upstream artifacts (agents, skills, rules,
* commands) under `agentic/code/{frameworks,addons}/*` and returns an
* id-indexed registry. Each entry carries the `safety-critical` flag (parsed
* from frontmatter for `.md` artifacts and from `manifest.json` at the bundle
* level), the source kind ('bundled' for npm-shipped, 'cache' for git-installed),
* and the absolute source path.
*
* Consumed by the shadow resolver (#1036) to detect collisions between project-
* local bundles and upstream artifacts and apply the override / safety-critical
* denylist policy from `.aiwg/architecture/adr-override-shadow-policy.md`.
*
* @implements #1036
*/
export type UpstreamArtifactType = 'agent' | 'skill' | 'rule' | 'command';
export type UpstreamSource = 'bundled' | 'cache';
export interface UpstreamArtifact {
/** Artifact id (rule frontmatter id, skill dir name, or filename minus extension) */
id: string;
type: UpstreamArtifactType;
/** Absolute path to the artifact file (or directory for skills) */
sourcePath: string;
/** Owning bundle directory name (e.g., "aiwg-utils", "sdlc-complete") */
bundleName: string;
/** Source kind — npm-shipped or git-installed */
source: UpstreamSource;
/** Whether the artifact is on the safety-critical denylist (#1041 §2) */
safetyCritical: boolean;
}
export interface UpstreamRegistry {
/** Lookup by `${type}:${id}` — matches the shadow detection key shape */
byKey: Map<string, UpstreamArtifact>;
/** Lookup by id alone, returning all artifacts (any type) with that id */
byId: Map<string, UpstreamArtifact[]>;
}
/** Scan all `agentic/code/{frameworks,addons}/*` bundles under the framework
* root (npm-bundled artifacts) plus an optional cache directory for git-
* installed artifacts. */
export declare function buildUpstreamRegistry(opts: {
frameworkRoot: string;
/** Optional directory of git-installed packages (e.g., ~/.cache/aiwg/packages). */
cacheRoot?: string;
}): Promise<UpstreamRegistry>;
//# sourceMappingURL=upstream-registry.d.ts.map