@ai-primitives-hub/app 0.0.1-alpha.1
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 +26 -0
- package/dist/collection/generate-skill.d.ts +43 -0
- package/dist/collection/generate-skill.d.ts.map +1 -0
- package/dist/collection/generate-skill.js +244 -0
- package/dist/collection/generate-skill.js.map +1 -0
- package/dist/collection/index.d.ts +8 -0
- package/dist/collection/index.d.ts.map +1 -0
- package/dist/collection/index.js +23 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/read-collection.d.ts +60 -0
- package/dist/collection/read-collection.d.ts.map +1 -0
- package/dist/collection/read-collection.js +291 -0
- package/dist/collection/read-collection.js.map +1 -0
- package/dist/context-detection/detector.d.ts +126 -0
- package/dist/context-detection/detector.d.ts.map +1 -0
- package/dist/context-detection/detector.js +408 -0
- package/dist/context-detection/detector.js.map +1 -0
- package/dist/context-detection/index.d.ts +11 -0
- package/dist/context-detection/index.d.ts.map +1 -0
- package/dist/context-detection/index.js +14 -0
- package/dist/context-detection/index.js.map +1 -0
- package/dist/context-detection/types.d.ts +74 -0
- package/dist/context-detection/types.d.ts.map +1 -0
- package/dist/context-detection/types.js +13 -0
- package/dist/context-detection/types.js.map +1 -0
- package/dist/discovery/index.d.ts +7 -0
- package/dist/discovery/index.d.ts.map +1 -0
- package/dist/discovery/index.js +23 -0
- package/dist/discovery/index.js.map +1 -0
- package/dist/discovery/profile-generator.d.ts +31 -0
- package/dist/discovery/profile-generator.d.ts.map +1 -0
- package/dist/discovery/profile-generator.js +55 -0
- package/dist/discovery/profile-generator.js.map +1 -0
- package/dist/discovery/recommendation-engine.d.ts +76 -0
- package/dist/discovery/recommendation-engine.d.ts.map +1 -0
- package/dist/discovery/recommendation-engine.js +210 -0
- package/dist/discovery/recommendation-engine.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/install/index.d.ts +14 -0
- package/dist/install/index.d.ts.map +1 -0
- package/dist/install/index.js +20 -0
- package/dist/install/index.js.map +1 -0
- package/dist/install/install-bundle.d.ts +31 -0
- package/dist/install/install-bundle.d.ts.map +1 -0
- package/dist/install/install-bundle.js +23 -0
- package/dist/install/install-bundle.js.map +1 -0
- package/dist/install/layout-resolver.d.ts +31 -0
- package/dist/install/layout-resolver.d.ts.map +1 -0
- package/dist/install/layout-resolver.js +70 -0
- package/dist/install/layout-resolver.js.map +1 -0
- package/dist/install/pipeline.d.ts +111 -0
- package/dist/install/pipeline.d.ts.map +1 -0
- package/dist/install/pipeline.js +138 -0
- package/dist/install/pipeline.js.map +1 -0
- package/dist/install/uninstall-bundle.d.ts +36 -0
- package/dist/install/uninstall-bundle.d.ts.map +1 -0
- package/dist/install/uninstall-bundle.js +37 -0
- package/dist/install/uninstall-bundle.js.map +1 -0
- package/dist/install/uninstall-pipeline.d.ts +119 -0
- package/dist/install/uninstall-pipeline.d.ts.map +1 -0
- package/dist/install/uninstall-pipeline.js +187 -0
- package/dist/install/uninstall-pipeline.js.map +1 -0
- package/dist/registry/activate-registry-profile.d.ts +67 -0
- package/dist/registry/activate-registry-profile.d.ts.map +1 -0
- package/dist/registry/activate-registry-profile.js +150 -0
- package/dist/registry/activate-registry-profile.js.map +1 -0
- package/dist/registry/create-source-adapter.d.ts +43 -0
- package/dist/registry/create-source-adapter.d.ts.map +1 -0
- package/dist/registry/create-source-adapter.js +53 -0
- package/dist/registry/create-source-adapter.js.map +1 -0
- package/dist/registry/deactivate-registry-profile.d.ts +38 -0
- package/dist/registry/deactivate-registry-profile.d.ts.map +1 -0
- package/dist/registry/deactivate-registry-profile.js +45 -0
- package/dist/registry/deactivate-registry-profile.js.map +1 -0
- package/dist/registry/detect-updates.d.ts +12 -0
- package/dist/registry/detect-updates.d.ts.map +1 -0
- package/dist/registry/detect-updates.js +76 -0
- package/dist/registry/detect-updates.js.map +1 -0
- package/dist/registry/hub-manager.d.ts +229 -0
- package/dist/registry/hub-manager.d.ts.map +1 -0
- package/dist/registry/hub-manager.js +473 -0
- package/dist/registry/hub-manager.js.map +1 -0
- package/dist/registry/index.d.ts +23 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +39 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/install-registry-bundle.d.ts +56 -0
- package/dist/registry/install-registry-bundle.d.ts.map +1 -0
- package/dist/registry/install-registry-bundle.js +150 -0
- package/dist/registry/install-registry-bundle.js.map +1 -0
- package/dist/registry/list-all-profiles.d.ts +27 -0
- package/dist/registry/list-all-profiles.d.ts.map +1 -0
- package/dist/registry/list-all-profiles.js +52 -0
- package/dist/registry/list-all-profiles.js.map +1 -0
- package/dist/registry/list-installed-bundles.d.ts +37 -0
- package/dist/registry/list-installed-bundles.d.ts.map +1 -0
- package/dist/registry/list-installed-bundles.js +27 -0
- package/dist/registry/list-installed-bundles.js.map +1 -0
- package/dist/registry/load-hub-sources.d.ts +56 -0
- package/dist/registry/load-hub-sources.d.ts.map +1 -0
- package/dist/registry/load-hub-sources.js +123 -0
- package/dist/registry/load-hub-sources.js.map +1 -0
- package/dist/registry/local-profile-crud.d.ts +58 -0
- package/dist/registry/local-profile-crud.d.ts.map +1 -0
- package/dist/registry/local-profile-crud.js +85 -0
- package/dist/registry/local-profile-crud.js.map +1 -0
- package/dist/registry/profile-lifecycle.d.ts +190 -0
- package/dist/registry/profile-lifecycle.d.ts.map +1 -0
- package/dist/registry/profile-lifecycle.js +400 -0
- package/dist/registry/profile-lifecycle.js.map +1 -0
- package/dist/registry/registry-settings.d.ts +32 -0
- package/dist/registry/registry-settings.d.ts.map +1 -0
- package/dist/registry/registry-settings.js +145 -0
- package/dist/registry/registry-settings.js.map +1 -0
- package/dist/registry/resolve-installation-bundle.d.ts +46 -0
- package/dist/registry/resolve-installation-bundle.d.ts.map +1 -0
- package/dist/registry/resolve-installation-bundle.js +98 -0
- package/dist/registry/resolve-installation-bundle.js.map +1 -0
- package/dist/registry/search-registry-bundles.d.ts +47 -0
- package/dist/registry/search-registry-bundles.d.ts.map +1 -0
- package/dist/registry/search-registry-bundles.js +129 -0
- package/dist/registry/search-registry-bundles.js.map +1 -0
- package/dist/registry/uninstall-installed-bundle.d.ts +48 -0
- package/dist/registry/uninstall-installed-bundle.d.ts.map +1 -0
- package/dist/registry/uninstall-installed-bundle.js +45 -0
- package/dist/registry/uninstall-installed-bundle.js.map +1 -0
- package/dist/registry/update-registry-bundle.d.ts +36 -0
- package/dist/registry/update-registry-bundle.d.ts.map +1 -0
- package/dist/registry/update-registry-bundle.js +113 -0
- package/dist/registry/update-registry-bundle.js.map +1 -0
- package/dist/registry/user-config-paths.d.ts +24 -0
- package/dist/registry/user-config-paths.d.ts.map +1 -0
- package/dist/registry/user-config-paths.js +82 -0
- package/dist/registry/user-config-paths.js.map +1 -0
- package/dist/registry/version-consolidator.d.ts +123 -0
- package/dist/registry/version-consolidator.d.ts.map +1 -0
- package/dist/registry/version-consolidator.js +231 -0
- package/dist/registry/version-consolidator.js.map +1 -0
- package/dist/search/export-profile.d.ts +63 -0
- package/dist/search/export-profile.d.ts.map +1 -0
- package/dist/search/export-profile.js +138 -0
- package/dist/search/export-profile.js.map +1 -0
- package/dist/search/index.d.ts +6 -0
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/index.js +22 -0
- package/dist/search/index.js.map +1 -0
- package/dist/stores/index.d.ts +8 -0
- package/dist/stores/index.d.ts.map +1 -0
- package/dist/stores/index.js +24 -0
- package/dist/stores/index.js.map +1 -0
- package/dist/stores/json-lockfile-store.d.ts +203 -0
- package/dist/stores/json-lockfile-store.d.ts.map +1 -0
- package/dist/stores/json-lockfile-store.js +277 -0
- package/dist/stores/json-lockfile-store.js.map +1 -0
- package/dist/transform/index.d.ts +10 -0
- package/dist/transform/index.d.ts.map +1 -0
- package/dist/transform/index.js +26 -0
- package/dist/transform/index.js.map +1 -0
- package/dist/transform/transformer-registry.d.ts +52 -0
- package/dist/transform/transformer-registry.d.ts.map +1 -0
- package/dist/transform/transformer-registry.js +53 -0
- package/dist/transform/transformer-registry.js.map +1 -0
- package/dist/transform/transformers/claude-code-transformer.d.ts +67 -0
- package/dist/transform/transformers/claude-code-transformer.d.ts.map +1 -0
- package/dist/transform/transformers/claude-code-transformer.js +140 -0
- package/dist/transform/transformers/claude-code-transformer.js.map +1 -0
- package/dist/transform/transformers/kiro-transformer.d.ts +51 -0
- package/dist/transform/transformers/kiro-transformer.d.ts.map +1 -0
- package/dist/transform/transformers/kiro-transformer.js +128 -0
- package/dist/transform/transformers/kiro-transformer.js.map +1 -0
- package/dist/transform/transformers/noop-transformer.d.ts +25 -0
- package/dist/transform/transformers/noop-transformer.d.ts.map +1 -0
- package/dist/transform/transformers/noop-transformer.js +20 -0
- package/dist/transform/transformers/noop-transformer.js.map +1 -0
- package/dist/transform/transformers/windsurf-transformer.d.ts +63 -0
- package/dist/transform/transformers/windsurf-transformer.d.ts.map +1 -0
- package/dist/transform/transformers/windsurf-transformer.js +125 -0
- package/dist/transform/transformers/windsurf-transformer.js.map +1 -0
- package/dist/update/auto-update.d.ts +84 -0
- package/dist/update/auto-update.d.ts.map +1 -0
- package/dist/update/auto-update.js +217 -0
- package/dist/update/auto-update.js.map +1 -0
- package/dist/update/check-updates.d.ts +51 -0
- package/dist/update/check-updates.d.ts.map +1 -0
- package/dist/update/check-updates.js +168 -0
- package/dist/update/check-updates.js.map +1 -0
- package/dist/update/index.d.ts +8 -0
- package/dist/update/index.d.ts.map +1 -0
- package/dist/update/index.js +24 -0
- package/dist/update/index.js.map +1 -0
- package/dist/update/log-event.d.ts +15 -0
- package/dist/update/log-event.d.ts.map +1 -0
- package/dist/update/log-event.js +11 -0
- package/dist/update/log-event.js.map +1 -0
- package/dist/writers/file-tree-writer.d.ts +136 -0
- package/dist/writers/file-tree-writer.d.ts.map +1 -0
- package/dist/writers/file-tree-writer.js +337 -0
- package/dist/writers/file-tree-writer.js.map +1 -0
- package/dist/writers/index.d.ts +7 -0
- package/dist/writers/index.d.ts.map +1 -0
- package/dist/writers/index.js +23 -0
- package/dist/writers/index.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { CopilotFileType, ExtractedFiles, LayoutConfigLoader, ResourceTransformer, Target, TargetLayout, TargetWriter, TargetWriteResult } from '@ai-primitives-hub/core';
|
|
2
|
+
export type { ExtractedFiles, } from '@ai-primitives-hub/core';
|
|
3
|
+
export type { TargetWriter, TargetWriteResult, } from '@ai-primitives-hub/core';
|
|
4
|
+
export interface WriterFs {
|
|
5
|
+
writeFile(p: string, contents: string): Promise<void>;
|
|
6
|
+
mkdir(p: string, opts?: {
|
|
7
|
+
recursive?: boolean;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
remove(p: string): Promise<void>;
|
|
10
|
+
exists(p: string): Promise<boolean>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A manifest-driven placement instruction: "this bundle-relative source
|
|
14
|
+
* file/directory is primitive `id` of Copilot type `type`". Used by
|
|
15
|
+
* `FileTreeTargetWriter.writeManifestItems` for targets/scopes (e.g. the
|
|
16
|
+
* VS Code extension's user/repository scopes) whose real on-disk
|
|
17
|
+
* convention renames every file to `{id}.{type-extension}` rather than
|
|
18
|
+
* preserving the bundle's own directory layout — see migration plan
|
|
19
|
+
* §7.5 item 2 for why this is a separate mode from `write()`'s
|
|
20
|
+
* prefix-preserving routing.
|
|
21
|
+
*/
|
|
22
|
+
export interface ManifestPlacementItem {
|
|
23
|
+
/** Manifest item id; used to compute the renamed on-disk file name. */
|
|
24
|
+
id: string;
|
|
25
|
+
/** Bundle-relative source path (looked up in the `ExtractedFiles` map). */
|
|
26
|
+
file: string;
|
|
27
|
+
/** Copilot file type; auto-detected from `file`/`tags` when omitted. */
|
|
28
|
+
type?: CopilotFileType;
|
|
29
|
+
tags?: string[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Result of a remove operation.
|
|
33
|
+
* Contains removed and skipped file paths.
|
|
34
|
+
*/
|
|
35
|
+
export interface TargetRemoveResult {
|
|
36
|
+
/** Absolute paths of files removed. */
|
|
37
|
+
removed: string[];
|
|
38
|
+
/** Files not found (skipped). */
|
|
39
|
+
skipped: string[];
|
|
40
|
+
}
|
|
41
|
+
export type { KindRoutes, TargetLayout } from '@ai-primitives-hub/core';
|
|
42
|
+
/**
|
|
43
|
+
* Resolve the layout for a given Target using the built-in defaults.
|
|
44
|
+
* Synchronous; uses the embedded JSON config (no filesystem IO).
|
|
45
|
+
* For hierarchical override support (user + project configs) use
|
|
46
|
+
* `resolveLayoutAsync` instead.
|
|
47
|
+
* @param target - Target to resolve.
|
|
48
|
+
* @returns Resolved TargetLayout.
|
|
49
|
+
*/
|
|
50
|
+
export declare const resolveLayout: (target: Target) => TargetLayout;
|
|
51
|
+
/**
|
|
52
|
+
* Resolve the layout for a given Target using all available layers
|
|
53
|
+
* (built-in + user config + project config).
|
|
54
|
+
* @param target - Target to resolve.
|
|
55
|
+
* @param loader - Layout config loader (injected for testability).
|
|
56
|
+
* @returns Resolved TargetLayout.
|
|
57
|
+
*/
|
|
58
|
+
export declare const resolveLayoutAsync: (target: Target, loader: LayoutConfigLoader) => Promise<TargetLayout>;
|
|
59
|
+
/**
|
|
60
|
+
* Expand `${VAR}` and leading `~` in a path. Pure; HOME comes from the
|
|
61
|
+
* injected env map.
|
|
62
|
+
* @param p - Path with possible ${VAR} or ~ tokens.
|
|
63
|
+
* @param env - Process env map.
|
|
64
|
+
* @returns Expanded path.
|
|
65
|
+
*/
|
|
66
|
+
export declare const expandPath: (p: string, env: Record<string, string | undefined>) => string;
|
|
67
|
+
/**
|
|
68
|
+
* Options for FileTreeTargetWriter.
|
|
69
|
+
*/
|
|
70
|
+
export interface FileTreeTargetWriterOptions {
|
|
71
|
+
fs: WriterFs;
|
|
72
|
+
/** Process env, used for ${VAR} expansion. */
|
|
73
|
+
env: Record<string, string | undefined>;
|
|
74
|
+
/** Optional resource transformer for target-specific content transformations. */
|
|
75
|
+
transformer?: ResourceTransformer;
|
|
76
|
+
/** Optional hierarchical layout loader; built-in defaults are used when omitted. */
|
|
77
|
+
layoutLoader?: LayoutConfigLoader;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Generic writer that routes bundle files into a target tree using
|
|
81
|
+
* the layout returned by resolveLayout(target).
|
|
82
|
+
*/
|
|
83
|
+
export declare class FileTreeTargetWriter implements TargetWriter {
|
|
84
|
+
private readonly opts;
|
|
85
|
+
/**
|
|
86
|
+
* Construct a FileTreeTargetWriter.
|
|
87
|
+
* @param opts Writer options including filesystem and environment.
|
|
88
|
+
*/
|
|
89
|
+
constructor(opts: FileTreeTargetWriterOptions);
|
|
90
|
+
/**
|
|
91
|
+
* Write the bundle into the target.
|
|
92
|
+
* @param target - Target chosen via `--target <name>`.
|
|
93
|
+
* @param files - Extracted bundle files.
|
|
94
|
+
* @returns TargetWriteResult.
|
|
95
|
+
*/
|
|
96
|
+
write(target: Target, files: ExtractedFiles): Promise<TargetWriteResult>;
|
|
97
|
+
/**
|
|
98
|
+
* Write bundle files into the target using manifest-driven, ID-based
|
|
99
|
+
* renaming rather than `write()`'s prefix-preserving routing.
|
|
100
|
+
*
|
|
101
|
+
* For each item: the Copilot file type (explicit or auto-detected from
|
|
102
|
+
* `file`/`tags`) selects the output subdirectory via
|
|
103
|
+
* {@link KIND_TO_ROUTE_KEY} + the layout's `kindRoutes`, and the output
|
|
104
|
+
* file name is `{id}.{type-extension}` (via `core`'s `getTargetFileName`)
|
|
105
|
+
* rather than the source file's own name. Skill items are the exception:
|
|
106
|
+
* every bundle file under the skill's `skills/<sourceId>/` prefix is
|
|
107
|
+
* copied, preserving its relative path, into
|
|
108
|
+
* `{baseDir}/{skillsRoute}/{normalizedId}/`.
|
|
109
|
+
* @param target - Target chosen via `--target <name>`.
|
|
110
|
+
* @param files - Extracted bundle files.
|
|
111
|
+
* @param items - Manifest-derived placement instructions.
|
|
112
|
+
* @returns TargetWriteResult.
|
|
113
|
+
*/
|
|
114
|
+
writeManifestItems(target: Target, files: ExtractedFiles, items: readonly ManifestPlacementItem[]): Promise<TargetWriteResult>;
|
|
115
|
+
private resolveLayout;
|
|
116
|
+
/**
|
|
117
|
+
* Copy every bundle file under a skill's `skills/<sourceId>/` prefix
|
|
118
|
+
* into `{baseDir}/{outPrefix}/{normalizedId}/`, preserving each file's
|
|
119
|
+
* relative path under the skill root.
|
|
120
|
+
* @param baseDir - Expanded target base directory.
|
|
121
|
+
* @param outPrefix - Layout output subdirectory for the `skill` kind.
|
|
122
|
+
* @param item - Skill placement item (its `file` points at the skill's
|
|
123
|
+
* manifest file, e.g. `skills/my-skill/SKILL.md`).
|
|
124
|
+
* @param files - Extracted bundle files.
|
|
125
|
+
* @param written - Accumulator for written absolute paths.
|
|
126
|
+
* @returns true if at least one file was written.
|
|
127
|
+
*/
|
|
128
|
+
private writeSkillItem;
|
|
129
|
+
/**
|
|
130
|
+
* Remove a file from the target.
|
|
131
|
+
* @param target - Target chosen via `--target <name>`.
|
|
132
|
+
* @param filePath - Relative file path to remove (from bundle root).
|
|
133
|
+
*/
|
|
134
|
+
remove(target: Target, filePath: string): Promise<void>;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=file-tree-writer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-tree-writer.d.ts","sourceRoot":"","sources":["../../src/writers/file-tree-writer.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EAEd,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAcjC,YAAY,EACV,cAAc,GACf,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EACV,YAAY,EACZ,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,CAAC,EAAE,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AAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,iFAAiF;IACjF,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,oFAAoF;IACpF,YAAY,CAAC,EAAE,kBAAkB,CAAC;CACnC;AAED;;;GAGG;AAEH,qBAAa,oBAAqB,YAAW,YAAY;IAKpC,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJxC;;;OAGG;gBACiC,IAAI,EAAE,2BAA2B;IAErE;;;;;OAKG;IACU,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAyDrF;;;;;;;;;;;;;;;;OAgBG;IACU,kBAAkB,CAC7B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,SAAS,qBAAqB,EAAE,GACtC,OAAO,CAAC,iBAAiB,CAAC;YAuDf,aAAa;IAO3B;;;;;;;;;;;OAWG;YACW,cAAc;IA6B5B;;;;OAIG;IACU,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAUrE"}
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.FileTreeTargetWriter = exports.expandPath = exports.resolveLayoutAsync = exports.resolveLayout = void 0;
|
|
37
|
+
/**
|
|
38
|
+
* TargetWriter interface + FileTreeTargetWriter.
|
|
39
|
+
*
|
|
40
|
+
* Writer = "given a Target, an Installable's manifest, and the
|
|
41
|
+
* extracted file map, route the bundle's primitive files into the
|
|
42
|
+
* target's filesystem layout".
|
|
43
|
+
*
|
|
44
|
+
* Layout definitions are loaded from a data-driven configuration
|
|
45
|
+
* (see `infra/writers/default-layouts.json`, re-exported through
|
|
46
|
+
* `@ai-primitives-hub/infra`'s barrel as `defaultLayouts` — this
|
|
47
|
+
* module deliberately does not keep its own copy; the reference
|
|
48
|
+
* branch this was ported from had two independently-drifted copies,
|
|
49
|
+
* one in `infra` and one here, which is exactly the defect this
|
|
50
|
+
* single-source-of-truth import avoids). The `resolveLayout` function
|
|
51
|
+
* is a synchronous compatibility shim that uses the built-in defaults
|
|
52
|
+
* only; async callers with a `LayoutConfigLoader` can use
|
|
53
|
+
* `resolveLayoutAsync` for hierarchical overrides (built-in → user →
|
|
54
|
+
* project).
|
|
55
|
+
*
|
|
56
|
+
* The writer is fully context-driven: no Node globals, all IO
|
|
57
|
+
* through the injected `WriterFs`.
|
|
58
|
+
* @module writers/file-tree-writer
|
|
59
|
+
*/
|
|
60
|
+
const path = __importStar(require("node:path"));
|
|
61
|
+
const core_1 = require("@ai-primitives-hub/core");
|
|
62
|
+
const infra_1 = require("@ai-primitives-hub/infra");
|
|
63
|
+
const layout_resolver_1 = require("../install/layout-resolver");
|
|
64
|
+
/**
|
|
65
|
+
* Maps a `CopilotFileType` to the `default-layouts.json` kindRoutes key
|
|
66
|
+
* whose *value* (the output subdirectory) applies to it. Chatmodes are
|
|
67
|
+
* deliberately routed through the agents key because they are associated
|
|
68
|
+
* with agents at runtime.
|
|
69
|
+
*/
|
|
70
|
+
const KIND_TO_ROUTE_KEY = {
|
|
71
|
+
prompt: 'prompts/',
|
|
72
|
+
instructions: 'instructions/',
|
|
73
|
+
chatmode: 'agents/',
|
|
74
|
+
agent: 'agents/',
|
|
75
|
+
skill: 'skills/'
|
|
76
|
+
};
|
|
77
|
+
// Satisfy local usage (TypeScript needs the types in scope for the functions below).
|
|
78
|
+
// The re-export above covers external callers.
|
|
79
|
+
/**
|
|
80
|
+
* Resolve the layout for a given Target using the built-in defaults.
|
|
81
|
+
* Synchronous; uses the embedded JSON config (no filesystem IO).
|
|
82
|
+
* For hierarchical override support (user + project configs) use
|
|
83
|
+
* `resolveLayoutAsync` instead.
|
|
84
|
+
* @param target - Target to resolve.
|
|
85
|
+
* @returns Resolved TargetLayout.
|
|
86
|
+
*/
|
|
87
|
+
const resolveLayout = (target) => {
|
|
88
|
+
const result = (0, layout_resolver_1.resolveLayoutFromLayers)(target, [infra_1.defaultLayouts]);
|
|
89
|
+
if (result === null) {
|
|
90
|
+
throw new Error(`No layout defined for target type "${target.type}"`);
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
};
|
|
94
|
+
exports.resolveLayout = resolveLayout;
|
|
95
|
+
/**
|
|
96
|
+
* Resolve the layout for a given Target using all available layers
|
|
97
|
+
* (built-in + user config + project config).
|
|
98
|
+
* @param target - Target to resolve.
|
|
99
|
+
* @param loader - Layout config loader (injected for testability).
|
|
100
|
+
* @returns Resolved TargetLayout.
|
|
101
|
+
*/
|
|
102
|
+
const resolveLayoutAsync = async (target, loader) => {
|
|
103
|
+
const layers = await loader.load();
|
|
104
|
+
const result = (0, layout_resolver_1.resolveLayoutFromLayers)(target, layers);
|
|
105
|
+
if (result === null) {
|
|
106
|
+
throw new Error(`No layout defined for target type "${target.type}"`);
|
|
107
|
+
}
|
|
108
|
+
return result;
|
|
109
|
+
};
|
|
110
|
+
exports.resolveLayoutAsync = resolveLayoutAsync;
|
|
111
|
+
/**
|
|
112
|
+
* Expand `${VAR}` and leading `~` in a path. Pure; HOME comes from the
|
|
113
|
+
* injected env map.
|
|
114
|
+
* @param p - Path with possible ${VAR} or ~ tokens.
|
|
115
|
+
* @param env - Process env map.
|
|
116
|
+
* @returns Expanded path.
|
|
117
|
+
*/
|
|
118
|
+
const expandPath = (p, env) => {
|
|
119
|
+
let out = p.replaceAll(/\$\{([A-Z0-9_]+)\}/g, (_m, name) => env[name] ?? '');
|
|
120
|
+
if (out.startsWith('~')) {
|
|
121
|
+
const home = env.HOME ?? env.USERPROFILE ?? '';
|
|
122
|
+
out = home + out.slice(1);
|
|
123
|
+
}
|
|
124
|
+
return out;
|
|
125
|
+
};
|
|
126
|
+
exports.expandPath = expandPath;
|
|
127
|
+
/**
|
|
128
|
+
* Generic writer that routes bundle files into a target tree using
|
|
129
|
+
* the layout returned by resolveLayout(target).
|
|
130
|
+
*/
|
|
131
|
+
/* eslint-disable @typescript-eslint/member-ordering -- public API kept above helpers. */
|
|
132
|
+
class FileTreeTargetWriter {
|
|
133
|
+
opts;
|
|
134
|
+
/**
|
|
135
|
+
* Construct a FileTreeTargetWriter.
|
|
136
|
+
* @param opts Writer options including filesystem and environment.
|
|
137
|
+
*/
|
|
138
|
+
constructor(opts) {
|
|
139
|
+
this.opts = opts;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Write the bundle into the target.
|
|
143
|
+
* @param target - Target chosen via `--target <name>`.
|
|
144
|
+
* @param files - Extracted bundle files.
|
|
145
|
+
* @returns TargetWriteResult.
|
|
146
|
+
*/
|
|
147
|
+
async write(target, files) {
|
|
148
|
+
const layout = await this.resolveLayout(target);
|
|
149
|
+
const baseDir = (0, exports.expandPath)(layout.baseDir, this.opts.env);
|
|
150
|
+
const skip = new Set(layout.skipPaths);
|
|
151
|
+
const allowed = target.allowedKinds === undefined ? null : new Set(target.allowedKinds);
|
|
152
|
+
const written = [];
|
|
153
|
+
const skipped = [];
|
|
154
|
+
// Eager mkdir of the routed-kind directories; reduces churn over
|
|
155
|
+
// calling mkdir per file. Per-kind subdir creation is recursive
|
|
156
|
+
// so root + nested dirs are covered.
|
|
157
|
+
for (const sub of Object.values(layout.kindRoutes)) {
|
|
158
|
+
await this.opts.fs.mkdir(path.join(baseDir, sub), { recursive: true });
|
|
159
|
+
}
|
|
160
|
+
for (const [bundlePath, bytes] of files) {
|
|
161
|
+
if (skip.has(bundlePath)) {
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
const route = pickRoute(bundlePath, layout.kindRoutes);
|
|
165
|
+
if (route === null) {
|
|
166
|
+
// Unrouted file; not an error (bundles may carry extras).
|
|
167
|
+
skipped.push(bundlePath);
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
// Skip when allowedKinds explicitly excludes this kind.
|
|
171
|
+
if (allowed !== null && !allowed.has(routeToKind(route.prefix))) {
|
|
172
|
+
skipped.push(bundlePath);
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
// Decode content
|
|
176
|
+
let content = new TextDecoder().decode(bytes);
|
|
177
|
+
// Apply transformation if transformer is provided
|
|
178
|
+
if (this.opts.transformer !== undefined) {
|
|
179
|
+
try {
|
|
180
|
+
const result = this.opts.transformer.transform({
|
|
181
|
+
target,
|
|
182
|
+
filePath: bundlePath,
|
|
183
|
+
content
|
|
184
|
+
});
|
|
185
|
+
content = result.content;
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
// Fail-safe: on transformation error, use original content
|
|
189
|
+
// In production, this would log a warning
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const outPath = path.join(baseDir, route.outPrefix, route.tail);
|
|
193
|
+
await this.opts.fs.mkdir(path.dirname(outPath), { recursive: true });
|
|
194
|
+
await this.opts.fs.writeFile(outPath, content);
|
|
195
|
+
written.push(outPath);
|
|
196
|
+
}
|
|
197
|
+
return { written, skipped };
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Write bundle files into the target using manifest-driven, ID-based
|
|
201
|
+
* renaming rather than `write()`'s prefix-preserving routing.
|
|
202
|
+
*
|
|
203
|
+
* For each item: the Copilot file type (explicit or auto-detected from
|
|
204
|
+
* `file`/`tags`) selects the output subdirectory via
|
|
205
|
+
* {@link KIND_TO_ROUTE_KEY} + the layout's `kindRoutes`, and the output
|
|
206
|
+
* file name is `{id}.{type-extension}` (via `core`'s `getTargetFileName`)
|
|
207
|
+
* rather than the source file's own name. Skill items are the exception:
|
|
208
|
+
* every bundle file under the skill's `skills/<sourceId>/` prefix is
|
|
209
|
+
* copied, preserving its relative path, into
|
|
210
|
+
* `{baseDir}/{skillsRoute}/{normalizedId}/`.
|
|
211
|
+
* @param target - Target chosen via `--target <name>`.
|
|
212
|
+
* @param files - Extracted bundle files.
|
|
213
|
+
* @param items - Manifest-derived placement instructions.
|
|
214
|
+
* @returns TargetWriteResult.
|
|
215
|
+
*/
|
|
216
|
+
async writeManifestItems(target, files, items) {
|
|
217
|
+
const layout = await this.resolveLayout(target);
|
|
218
|
+
const baseDir = (0, exports.expandPath)(layout.baseDir, this.opts.env);
|
|
219
|
+
const allowed = target.allowedKinds === undefined ? null : new Set(target.allowedKinds);
|
|
220
|
+
const written = [];
|
|
221
|
+
const skipped = [];
|
|
222
|
+
for (const item of items) {
|
|
223
|
+
const type = item.type ?? (0, core_1.determineFileType)(item.file, item.tags);
|
|
224
|
+
const routeKey = KIND_TO_ROUTE_KEY[type];
|
|
225
|
+
// `allowedKinds` is keyed on the same vocabulary as `write()`'s
|
|
226
|
+
// `routeToKind` (plural route-key names, e.g. "skills"/"prompts"),
|
|
227
|
+
// not on the singular `CopilotFileType` domain vocabulary.
|
|
228
|
+
if (allowed !== null && !allowed.has(routeToKind(routeKey))) {
|
|
229
|
+
skipped.push(item.file);
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
const outPrefix = layout.kindRoutes[routeKey];
|
|
233
|
+
if (outPrefix === undefined) {
|
|
234
|
+
// Target's layout has no route for this kind at all.
|
|
235
|
+
skipped.push(item.file);
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
if (type === 'skill') {
|
|
239
|
+
const wroteAny = await this.writeSkillItem(baseDir, outPrefix, item, files, written);
|
|
240
|
+
if (!wroteAny) {
|
|
241
|
+
skipped.push(item.file);
|
|
242
|
+
}
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
const bytes = files.get(item.file);
|
|
246
|
+
if (bytes === undefined) {
|
|
247
|
+
skipped.push(item.file);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
const outPath = path.join(baseDir, outPrefix, (0, core_1.getTargetFileName)(item.id, type));
|
|
251
|
+
let content = new TextDecoder().decode(bytes);
|
|
252
|
+
if (this.opts.transformer !== undefined) {
|
|
253
|
+
try {
|
|
254
|
+
const result = this.opts.transformer.transform({ target, filePath: item.file, content });
|
|
255
|
+
content = result.content;
|
|
256
|
+
}
|
|
257
|
+
catch {
|
|
258
|
+
// Fail-safe: on transformation error, use original content
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
await this.opts.fs.mkdir(path.dirname(outPath), { recursive: true });
|
|
262
|
+
await this.opts.fs.writeFile(outPath, content);
|
|
263
|
+
written.push(outPath);
|
|
264
|
+
}
|
|
265
|
+
return { written, skipped };
|
|
266
|
+
}
|
|
267
|
+
async resolveLayout(target) {
|
|
268
|
+
if (this.opts.layoutLoader === undefined) {
|
|
269
|
+
return (0, exports.resolveLayout)(target);
|
|
270
|
+
}
|
|
271
|
+
return await (0, exports.resolveLayoutAsync)(target, this.opts.layoutLoader);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Copy every bundle file under a skill's `skills/<sourceId>/` prefix
|
|
275
|
+
* into `{baseDir}/{outPrefix}/{normalizedId}/`, preserving each file's
|
|
276
|
+
* relative path under the skill root.
|
|
277
|
+
* @param baseDir - Expanded target base directory.
|
|
278
|
+
* @param outPrefix - Layout output subdirectory for the `skill` kind.
|
|
279
|
+
* @param item - Skill placement item (its `file` points at the skill's
|
|
280
|
+
* manifest file, e.g. `skills/my-skill/SKILL.md`).
|
|
281
|
+
* @param files - Extracted bundle files.
|
|
282
|
+
* @param written - Accumulator for written absolute paths.
|
|
283
|
+
* @returns true if at least one file was written.
|
|
284
|
+
*/
|
|
285
|
+
async writeSkillItem(baseDir, outPrefix, item, files, written) {
|
|
286
|
+
if ((0, core_1.getSkillName)(item.file) === null) {
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
const targetSkillId = (0, core_1.normalizePromptId)(item.id);
|
|
290
|
+
const sourcePrefix = `${path.posix.dirname(item.file)}/`;
|
|
291
|
+
let wroteAny = false;
|
|
292
|
+
for (const [bundlePath, bytes] of files) {
|
|
293
|
+
if (!bundlePath.startsWith(sourcePrefix)) {
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
const tail = bundlePath.slice(sourcePrefix.length);
|
|
297
|
+
const outPath = path.join(baseDir, outPrefix, targetSkillId, tail);
|
|
298
|
+
await this.opts.fs.mkdir(path.dirname(outPath), { recursive: true });
|
|
299
|
+
await this.opts.fs.writeFile(outPath, new TextDecoder().decode(bytes));
|
|
300
|
+
written.push(outPath);
|
|
301
|
+
wroteAny = true;
|
|
302
|
+
}
|
|
303
|
+
return wroteAny;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Remove a file from the target.
|
|
307
|
+
* @param target - Target chosen via `--target <name>`.
|
|
308
|
+
* @param filePath - Relative file path to remove (from bundle root).
|
|
309
|
+
*/
|
|
310
|
+
async remove(target, filePath) {
|
|
311
|
+
const layout = await this.resolveLayout(target);
|
|
312
|
+
const baseDir = (0, exports.expandPath)(layout.baseDir, this.opts.env);
|
|
313
|
+
const route = pickRoute(filePath, layout.kindRoutes);
|
|
314
|
+
if (route === null) {
|
|
315
|
+
return; // Unrouted file, nothing to do
|
|
316
|
+
}
|
|
317
|
+
const outPath = path.join(baseDir, route.outPrefix, route.tail);
|
|
318
|
+
await this.opts.fs.remove(outPath);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
exports.FileTreeTargetWriter = FileTreeTargetWriter;
|
|
322
|
+
const pickRoute = (bundlePath, routes) => {
|
|
323
|
+
for (const [prefix, outPrefix] of Object.entries(routes)) {
|
|
324
|
+
if (bundlePath.startsWith(prefix)) {
|
|
325
|
+
return { prefix, outPrefix, tail: bundlePath.slice(prefix.length) };
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return null;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* Map a layout prefix back to the primitive kind it represents.
|
|
332
|
+
* Used to honor `target.allowedKinds`.
|
|
333
|
+
* @param prefix - Layout prefix (e.g., "prompts/").
|
|
334
|
+
* @returns Kind name without trailing slash.
|
|
335
|
+
*/
|
|
336
|
+
const routeToKind = (prefix) => prefix.replace(/\/$/, '');
|
|
337
|
+
//# sourceMappingURL=file-tree-writer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-tree-writer.js","sourceRoot":"","sources":["../../src/writers/file-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C;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAChE,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACF;AAjND,oDAiNC;AAQD,MAAM,SAAS,GAAG,CAAC,UAAkB,EAAE,MAAkB,EAAsB,EAAE;IAC/E,KAAK,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACzD,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACtE,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/writers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* Writers subsystem barrel export (app-layer compositions over infra's
|
|
19
|
+
* per-target writers).
|
|
20
|
+
* @module writers
|
|
21
|
+
*/
|
|
22
|
+
__exportStar(require("./file-tree-writer"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/writers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,qDAAmC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ai-primitives-hub/app",
|
|
3
|
+
"version": "0.0.1-alpha.1",
|
|
4
|
+
"description": "Use-case orchestration for AI Primitives Hub: install/uninstall pipelines, registry (hub/profile), discovery and search, multi-target content transforms. Also the public SDK surface until a standalone sdk package has a real consumer.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/AmadeusITGroup/ai-primitives-hub.git",
|
|
11
|
+
"directory": "packages/app"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"ai-primitives-hub",
|
|
15
|
+
"app",
|
|
16
|
+
"use-cases",
|
|
17
|
+
"orchestration"
|
|
18
|
+
],
|
|
19
|
+
"author": {
|
|
20
|
+
"name": "Amadeus IT Group",
|
|
21
|
+
"email": "opensource@amadeus.com"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"js-yaml": "^4.1.1",
|
|
28
|
+
"@ai-primitives-hub/core": "0.0.1-alpha.1",
|
|
29
|
+
"@ai-primitives-hub/infra": "0.0.1-alpha.1"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/js-yaml": "^4.0.9",
|
|
33
|
+
"@types/node": "^22.0.0",
|
|
34
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
35
|
+
"typescript": "^5.9.3",
|
|
36
|
+
"vitest": "^4.1.7"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=18.0.0"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc",
|
|
43
|
+
"watch": "tsc --watch",
|
|
44
|
+
"lint": "eslint src test",
|
|
45
|
+
"lint:fix": "eslint src test --fix",
|
|
46
|
+
"test": "vitest run",
|
|
47
|
+
"test:watch": "vitest",
|
|
48
|
+
"test:coverage": "vitest run --coverage"
|
|
49
|
+
}
|
|
50
|
+
}
|