@ai-primitives-hub/core 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.
Files changed (199) hide show
  1. package/README.md +18 -0
  2. package/dist/domain/bundle/id.d.ts +60 -0
  3. package/dist/domain/bundle/id.d.ts.map +1 -0
  4. package/dist/domain/bundle/id.js +75 -0
  5. package/dist/domain/bundle/id.js.map +1 -0
  6. package/dist/domain/bundle/identity-matcher.d.ts +48 -0
  7. package/dist/domain/bundle/identity-matcher.d.ts.map +1 -0
  8. package/dist/domain/bundle/identity-matcher.js +57 -0
  9. package/dist/domain/bundle/identity-matcher.js.map +1 -0
  10. package/dist/domain/bundle/types.d.ts +138 -0
  11. package/dist/domain/bundle/types.d.ts.map +1 -0
  12. package/dist/domain/bundle/types.js +17 -0
  13. package/dist/domain/bundle/types.js.map +1 -0
  14. package/dist/domain/bundle/version.d.ts +51 -0
  15. package/dist/domain/bundle/version.d.ts.map +1 -0
  16. package/dist/domain/bundle/version.js +176 -0
  17. package/dist/domain/bundle/version.js.map +1 -0
  18. package/dist/domain/collection/manifest-validator.d.ts +47 -0
  19. package/dist/domain/collection/manifest-validator.d.ts.map +1 -0
  20. package/dist/domain/collection/manifest-validator.js +83 -0
  21. package/dist/domain/collection/manifest-validator.js.map +1 -0
  22. package/dist/domain/collection/types.d.ts +201 -0
  23. package/dist/domain/collection/types.d.ts.map +1 -0
  24. package/dist/domain/collection/types.js +17 -0
  25. package/dist/domain/collection/types.js.map +1 -0
  26. package/dist/domain/collection/validate.d.ts +51 -0
  27. package/dist/domain/collection/validate.d.ts.map +1 -0
  28. package/dist/domain/collection/validate.js +263 -0
  29. package/dist/domain/collection/validate.js.map +1 -0
  30. package/dist/domain/discovery/types.d.ts +95 -0
  31. package/dist/domain/discovery/types.d.ts.map +1 -0
  32. package/dist/domain/discovery/types.js +13 -0
  33. package/dist/domain/discovery/types.js.map +1 -0
  34. package/dist/domain/errors.d.ts +23 -0
  35. package/dist/domain/errors.d.ts.map +1 -0
  36. package/dist/domain/errors.js +41 -0
  37. package/dist/domain/errors.js.map +1 -0
  38. package/dist/domain/hub/types.d.ts +254 -0
  39. package/dist/domain/hub/types.d.ts.map +1 -0
  40. package/dist/domain/hub/types.js +11 -0
  41. package/dist/domain/hub/types.js.map +1 -0
  42. package/dist/domain/hub/validate.d.ts +40 -0
  43. package/dist/domain/hub/validate.d.ts.map +1 -0
  44. package/dist/domain/hub/validate.js +89 -0
  45. package/dist/domain/hub/validate.js.map +1 -0
  46. package/dist/domain/index.d.ts +31 -0
  47. package/dist/domain/index.d.ts.map +1 -0
  48. package/dist/domain/index.js +47 -0
  49. package/dist/domain/index.js.map +1 -0
  50. package/dist/domain/install/copilot-file-type.d.ts +84 -0
  51. package/dist/domain/install/copilot-file-type.d.ts.map +1 -0
  52. package/dist/domain/install/copilot-file-type.js +190 -0
  53. package/dist/domain/install/copilot-file-type.js.map +1 -0
  54. package/dist/domain/install/installable.d.ts +58 -0
  55. package/dist/domain/install/installable.d.ts.map +1 -0
  56. package/dist/domain/install/installable.js +36 -0
  57. package/dist/domain/install/installable.js.map +1 -0
  58. package/dist/domain/install/layout.d.ts +84 -0
  59. package/dist/domain/install/layout.d.ts.map +1 -0
  60. package/dist/domain/install/layout.js +70 -0
  61. package/dist/domain/install/layout.js.map +1 -0
  62. package/dist/domain/install/target.d.ts +70 -0
  63. package/dist/domain/install/target.d.ts.map +1 -0
  64. package/dist/domain/install/target.js +43 -0
  65. package/dist/domain/install/target.js.map +1 -0
  66. package/dist/domain/install/transform.d.ts +47 -0
  67. package/dist/domain/install/transform.d.ts.map +1 -0
  68. package/dist/domain/install/transform.js +24 -0
  69. package/dist/domain/install/transform.js.map +1 -0
  70. package/dist/domain/install/types.d.ts +51 -0
  71. package/dist/domain/install/types.d.ts.map +1 -0
  72. package/dist/domain/install/types.js +3 -0
  73. package/dist/domain/install/types.js.map +1 -0
  74. package/dist/domain/primitive/types.d.ts +59 -0
  75. package/dist/domain/primitive/types.d.ts.map +1 -0
  76. package/dist/domain/primitive/types.js +22 -0
  77. package/dist/domain/primitive/types.js.map +1 -0
  78. package/dist/domain/registry/guards.d.ts +28 -0
  79. package/dist/domain/registry/guards.d.ts.map +1 -0
  80. package/dist/domain/registry/guards.js +33 -0
  81. package/dist/domain/registry/guards.js.map +1 -0
  82. package/dist/domain/registry/settings.d.ts +49 -0
  83. package/dist/domain/registry/settings.d.ts.map +1 -0
  84. package/dist/domain/registry/settings.js +3 -0
  85. package/dist/domain/registry/settings.js.map +1 -0
  86. package/dist/domain/registry/types.d.ts +91 -0
  87. package/dist/domain/registry/types.d.ts.map +1 -0
  88. package/dist/domain/registry/types.js +3 -0
  89. package/dist/domain/registry/types.js.map +1 -0
  90. package/dist/domain/registry-error.d.ts +69 -0
  91. package/dist/domain/registry-error.d.ts.map +1 -0
  92. package/dist/domain/registry-error.js +87 -0
  93. package/dist/domain/registry-error.js.map +1 -0
  94. package/dist/domain/scaffold/index.d.ts +9 -0
  95. package/dist/domain/scaffold/index.d.ts.map +1 -0
  96. package/dist/domain/scaffold/index.js +13 -0
  97. package/dist/domain/scaffold/index.js.map +1 -0
  98. package/dist/domain/scaffold/types.d.ts +135 -0
  99. package/dist/domain/scaffold/types.d.ts.map +1 -0
  100. package/dist/domain/scaffold/types.js +44 -0
  101. package/dist/domain/scaffold/types.js.map +1 -0
  102. package/dist/domain/skill/validate.d.ts +52 -0
  103. package/dist/domain/skill/validate.d.ts.map +1 -0
  104. package/dist/domain/skill/validate.js +108 -0
  105. package/dist/domain/skill/validate.js.map +1 -0
  106. package/dist/domain/source/types.d.ts +72 -0
  107. package/dist/domain/source/types.d.ts.map +1 -0
  108. package/dist/domain/source/types.js +14 -0
  109. package/dist/domain/source/types.js.map +1 -0
  110. package/dist/domain/source-id.d.ts +41 -0
  111. package/dist/domain/source-id.d.ts.map +1 -0
  112. package/dist/domain/source-id.js +90 -0
  113. package/dist/domain/source-id.js.map +1 -0
  114. package/dist/index.d.ts +21 -0
  115. package/dist/index.d.ts.map +1 -0
  116. package/dist/index.js +74 -0
  117. package/dist/index.js.map +1 -0
  118. package/dist/ports/app-storage.d.ts +65 -0
  119. package/dist/ports/app-storage.d.ts.map +1 -0
  120. package/dist/ports/app-storage.js +22 -0
  121. package/dist/ports/app-storage.js.map +1 -0
  122. package/dist/ports/bundle-downloader.d.ts +28 -0
  123. package/dist/ports/bundle-downloader.d.ts.map +1 -0
  124. package/dist/ports/bundle-downloader.js +3 -0
  125. package/dist/ports/bundle-downloader.js.map +1 -0
  126. package/dist/ports/bundle-extractor.d.ts +21 -0
  127. package/dist/ports/bundle-extractor.d.ts.map +1 -0
  128. package/dist/ports/bundle-extractor.js +8 -0
  129. package/dist/ports/bundle-extractor.js.map +1 -0
  130. package/dist/ports/clock.d.ts +29 -0
  131. package/dist/ports/clock.d.ts.map +1 -0
  132. package/dist/ports/clock.js +13 -0
  133. package/dist/ports/clock.js.map +1 -0
  134. package/dist/ports/copilot-sdk.d.ts +80 -0
  135. package/dist/ports/copilot-sdk.d.ts.map +1 -0
  136. package/dist/ports/copilot-sdk.js +16 -0
  137. package/dist/ports/copilot-sdk.js.map +1 -0
  138. package/dist/ports/filesystem.d.ts +53 -0
  139. package/dist/ports/filesystem.d.ts.map +1 -0
  140. package/dist/ports/filesystem.js +14 -0
  141. package/dist/ports/filesystem.js.map +1 -0
  142. package/dist/ports/github-api.d.ts +62 -0
  143. package/dist/ports/github-api.d.ts.map +1 -0
  144. package/dist/ports/github-api.js +19 -0
  145. package/dist/ports/github-api.js.map +1 -0
  146. package/dist/ports/http.d.ts +58 -0
  147. package/dist/ports/http.d.ts.map +1 -0
  148. package/dist/ports/http.js +12 -0
  149. package/dist/ports/http.js.map +1 -0
  150. package/dist/ports/index.d.ts +23 -0
  151. package/dist/ports/index.d.ts.map +1 -0
  152. package/dist/ports/index.js +39 -0
  153. package/dist/ports/index.js.map +1 -0
  154. package/dist/ports/layout-config-loader.d.ts +27 -0
  155. package/dist/ports/layout-config-loader.d.ts.map +1 -0
  156. package/dist/ports/layout-config-loader.js +3 -0
  157. package/dist/ports/layout-config-loader.js.map +1 -0
  158. package/dist/ports/process-runner.d.ts +31 -0
  159. package/dist/ports/process-runner.d.ts.map +1 -0
  160. package/dist/ports/process-runner.js +14 -0
  161. package/dist/ports/process-runner.js.map +1 -0
  162. package/dist/ports/registry-operations.d.ts +157 -0
  163. package/dist/ports/registry-operations.d.ts.map +1 -0
  164. package/dist/ports/registry-operations.js +3 -0
  165. package/dist/ports/registry-operations.js.map +1 -0
  166. package/dist/ports/resource-transformer.d.ts +28 -0
  167. package/dist/ports/resource-transformer.d.ts.map +1 -0
  168. package/dist/ports/resource-transformer.js +3 -0
  169. package/dist/ports/resource-transformer.js.map +1 -0
  170. package/dist/ports/source-adapter.d.ts +43 -0
  171. package/dist/ports/source-adapter.d.ts.map +1 -0
  172. package/dist/ports/source-adapter.js +3 -0
  173. package/dist/ports/source-adapter.js.map +1 -0
  174. package/dist/ports/source-resolver.d.ts +19 -0
  175. package/dist/ports/source-resolver.d.ts.map +1 -0
  176. package/dist/ports/source-resolver.js +3 -0
  177. package/dist/ports/source-resolver.js.map +1 -0
  178. package/dist/ports/target-writer.d.ts +37 -0
  179. package/dist/ports/target-writer.d.ts.map +1 -0
  180. package/dist/ports/target-writer.js +3 -0
  181. package/dist/ports/target-writer.js.map +1 -0
  182. package/dist/ports/telemetry.d.ts +22 -0
  183. package/dist/ports/telemetry.d.ts.map +1 -0
  184. package/dist/ports/telemetry.js +11 -0
  185. package/dist/ports/telemetry.js.map +1 -0
  186. package/dist/ports/update-notifier.d.ts +22 -0
  187. package/dist/ports/update-notifier.d.ts.map +1 -0
  188. package/dist/ports/update-notifier.js +12 -0
  189. package/dist/ports/update-notifier.js.map +1 -0
  190. package/dist/ports/update-store.d.ts +25 -0
  191. package/dist/ports/update-store.d.ts.map +1 -0
  192. package/dist/ports/update-store.js +12 -0
  193. package/dist/ports/update-store.js.map +1 -0
  194. package/dist/public/schemas/apm.schema.json +59 -0
  195. package/dist/public/schemas/collection.schema.json +345 -0
  196. package/dist/public/schemas/default-hubs-config.schema.json +68 -0
  197. package/dist/public/schemas/hub-config.schema.json +389 -0
  198. package/dist/public/schemas/lockfile.schema.json +243 -0
  199. package/package.json +50 -0
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /**
3
+ * HTTP port — network abstraction for source adapters and the install
4
+ * pipeline.
5
+ *
6
+ * `app`/`infra` non-adapter code depends only on this interface, never on
7
+ * `fetch`/`axios`/`node:http` directly. The production adapter
8
+ * (`@ai-primitives-hub/infra`, Phase 3) wraps the real HTTP client.
9
+ * @module ports/http
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/ports/http.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Ports layer barrel export.
3
+ * @module ports
4
+ */
5
+ export * from './source-adapter';
6
+ export * from './app-storage';
7
+ export * from './clock';
8
+ export * from './copilot-sdk';
9
+ export * from './filesystem';
10
+ export * from './http';
11
+ export * from './github-api';
12
+ export * from './process-runner';
13
+ export * from './bundle-extractor';
14
+ export * from './target-writer';
15
+ export * from './layout-config-loader';
16
+ export * from './resource-transformer';
17
+ export * from './source-resolver';
18
+ export * from './bundle-downloader';
19
+ export * from './registry-operations';
20
+ export * from './update-store';
21
+ export * from './update-notifier';
22
+ export * from './telemetry';
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ports/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,39 @@
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
+ * Ports layer barrel export.
19
+ * @module ports
20
+ */
21
+ __exportStar(require("./source-adapter"), exports);
22
+ __exportStar(require("./app-storage"), exports);
23
+ __exportStar(require("./clock"), exports);
24
+ __exportStar(require("./copilot-sdk"), exports);
25
+ __exportStar(require("./filesystem"), exports);
26
+ __exportStar(require("./http"), exports);
27
+ __exportStar(require("./github-api"), exports);
28
+ __exportStar(require("./process-runner"), exports);
29
+ __exportStar(require("./bundle-extractor"), exports);
30
+ __exportStar(require("./target-writer"), exports);
31
+ __exportStar(require("./layout-config-loader"), exports);
32
+ __exportStar(require("./resource-transformer"), exports);
33
+ __exportStar(require("./source-resolver"), exports);
34
+ __exportStar(require("./bundle-downloader"), exports);
35
+ __exportStar(require("./registry-operations"), exports);
36
+ __exportStar(require("./update-store"), exports);
37
+ __exportStar(require("./update-notifier"), exports);
38
+ __exportStar(require("./telemetry"), exports);
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ports/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,mDAAiC;AACjC,gDAA8B;AAC9B,0CAAwB;AACxB,gDAA8B;AAC9B,+CAA6B;AAC7B,yCAAuB;AACvB,+CAA6B;AAC7B,mDAAiC;AACjC,qDAAmC;AACnC,kDAAgC;AAChC,yDAAuC;AACvC,yDAAuC;AACvC,oDAAkC;AAClC,sDAAoC;AACpC,wDAAsC;AACtC,iDAA+B;AAC/B,oDAAkC;AAClC,8CAA4B"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * LayoutConfigLoader port — abstract interface for loading target layout
3
+ * configuration layers.
4
+ *
5
+ * The concrete implementation in `infra/stores/layout-config-store.ts`
6
+ * reads from the filesystem hierarchy (built-in → user → project).
7
+ * Tests inject a stub that returns a fixed set of layers.
8
+ * @module ports/layout-config-loader
9
+ */
10
+ import type { TargetLayoutsConfig } from '../domain/install/layout';
11
+ /**
12
+ * Loads the ordered list of layout configuration layers.
13
+ *
14
+ * Layers are returned from least-specific to most-specific:
15
+ * `[built-in, user, project]`. The resolver merges them in order so
16
+ * later layers take precedence.
17
+ *
18
+ * Implementations must always include at least the built-in layer.
19
+ */
20
+ export interface LayoutConfigLoader {
21
+ /**
22
+ * Load and return all available layout config layers.
23
+ * @returns Ordered array of configs — at minimum `[builtIn]`.
24
+ */
25
+ load(): Promise<TargetLayoutsConfig[]>;
26
+ }
27
+ //# sourceMappingURL=layout-config-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-config-loader.d.ts","sourceRoot":"","sources":["../../src/ports/layout-config-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EACV,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAElC;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;CACxC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=layout-config-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-config-loader.js","sourceRoot":"","sources":["../../src/ports/layout-config-loader.ts"],"names":[],"mappings":""}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Process-execution port — shells out to external CLIs.
3
+ *
4
+ * Needed by adapters that delegate to a third-party command-line tool
5
+ * rather than a plain HTTP API (the `apm` CLI for `ApmAdapter`, Phase 3a).
6
+ * A narrower, purpose-built shell-out already exists for a single command
7
+ * (`infra/auth/gh-cli-token-provider.ts`'s `ExecFn`, for `gh auth token`);
8
+ * this is the general-purpose counterpart for adapters that need to run
9
+ * more than one distinct command with `cwd`/`env`/timeout control.
10
+ * @module ports/process-runner
11
+ */
12
+ export interface ProcessResult {
13
+ stdout: string;
14
+ stderr: string;
15
+ }
16
+ export interface ProcessRunOptions {
17
+ /** Working directory for the spawned process; defaults to the current process's cwd. */
18
+ cwd?: string;
19
+ /** Additional/overriding environment variables, merged on top of the current process's environment. */
20
+ env?: Record<string, string | undefined>;
21
+ /** Kills the process and rejects if it hasn't exited within this many milliseconds. */
22
+ timeoutMs?: number;
23
+ }
24
+ /**
25
+ * Runs a shell command line and resolves with its output, or rejects if
26
+ * the process exits non-zero, is killed, or times out.
27
+ */
28
+ export interface ProcessRunner {
29
+ exec(command: string, options?: ProcessRunOptions): Promise<ProcessResult>;
30
+ }
31
+ //# sourceMappingURL=process-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-runner.d.ts","sourceRoot":"","sources":["../../src/ports/process-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,wFAAwF;IACxF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uGAAuG;IACvG,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,uFAAuF;IACvF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC5E"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ /**
3
+ * Process-execution port — shells out to external CLIs.
4
+ *
5
+ * Needed by adapters that delegate to a third-party command-line tool
6
+ * rather than a plain HTTP API (the `apm` CLI for `ApmAdapter`, Phase 3a).
7
+ * A narrower, purpose-built shell-out already exists for a single command
8
+ * (`infra/auth/gh-cli-token-provider.ts`'s `ExecFn`, for `gh auth token`);
9
+ * this is the general-purpose counterpart for adapters that need to run
10
+ * more than one distinct command with `cwd`/`env`/timeout control.
11
+ * @module ports/process-runner
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ //# sourceMappingURL=process-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-runner.js","sourceRoot":"","sources":["../../src/ports/process-runner.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG"}
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Narrow, interface-segregated slices of a registry orchestrator's
3
+ * (the extension's `RegistryManager`, eventually `app`'s own registry
4
+ * use-cases) surface — just enough for the update-checking/auto-update
5
+ * use cases to depend on, without depending on the full orchestrator
6
+ * (which also owns discovery, install, profile management, ...) or
7
+ * risking a circular dependency with it.
8
+ *
9
+ * Ported from `src/services/auto-update-service.ts`'s local
10
+ * `BundleOperations`/`SourceOperations` interfaces (kept field-for-field
11
+ * identical — the extension's production wiring in `extension.ts`
12
+ * already constructs plain object literals satisfying exactly this
13
+ * shape) plus a new `UpdateRegistryReader` for `UpdateChecker`'s
14
+ * slightly different, read-only needs.
15
+ * @module ports/registry-operations
16
+ */
17
+ import type { Bundle, BundleUpdate } from '../domain/bundle/types';
18
+ import type { HubProfileWithMetadata, ProfileActivationState } from '../domain/hub/types';
19
+ import type { InstallationScope, InstalledBundle } from '../domain/install/types';
20
+ import type { ExportedSettingsConfiguration } from '../domain/registry/settings';
21
+ import type { Profile } from '../domain/registry/types';
22
+ import type { RegistrySource } from '../domain/source/types';
23
+ /**
24
+ * Bundle-level mutation/query operations needed to perform and verify an
25
+ * update (and roll it back on failure).
26
+ */
27
+ export interface BundleOperations {
28
+ updateBundle(bundleId: string, version?: string): Promise<void>;
29
+ listInstalledBundles(): Promise<InstalledBundle[]>;
30
+ getBundleDetails(bundleId: string): Promise<Bundle>;
31
+ }
32
+ /**
33
+ * Source synchronization operations needed before trusting a source's
34
+ * cached bundle data for an update.
35
+ */
36
+ export interface SourceOperations {
37
+ listSources(): Promise<RegistrySource[]>;
38
+ syncSource(sourceId: string): Promise<void>;
39
+ }
40
+ /**
41
+ * Source read/write operations needed to sync a hub's declared sources
42
+ * into the registry: list existing sources to detect duplicates/updates
43
+ * against, add genuinely new ones, and update ones that already came
44
+ * from the same hub. Deliberately narrower than a full source-CRUD
45
+ * port (no `removeSource`) since hub-source syncing never deletes.
46
+ */
47
+ export interface HubSourceSync {
48
+ listSources(): Promise<RegistrySource[]>;
49
+ addSource(source: RegistrySource): Promise<void>;
50
+ updateSource(sourceId: string, updates: Partial<RegistrySource>): Promise<void>;
51
+ }
52
+ /**
53
+ * Registry operations needed while activating a hub profile: properly
54
+ * deactivate a previously-active profile elsewhere (uninstalling its
55
+ * bundles, not just clearing its flag), and install the newly-active
56
+ * profile's bundles. Optional dependency of `activateProfile` — when
57
+ * absent, the caller falls back to flag-only bookkeeping and skips
58
+ * installation (mirrors the extension's own `if (this.registryManager)`
59
+ * branching in `src/services/hub-manager.ts`).
60
+ */
61
+ export interface ProfileLifecycleSync {
62
+ deactivateProfile(profileId: string): Promise<void>;
63
+ installBundles(items: {
64
+ bundleId: string;
65
+ options: {
66
+ scope: 'user';
67
+ force: boolean;
68
+ profileId: string;
69
+ };
70
+ }[]): Promise<void>;
71
+ }
72
+ /**
73
+ * The read-only registry surface `UpdateChecker` needs: sync sources,
74
+ * compare installed vs. latest versions, and enrich the result with
75
+ * per-bundle metadata.
76
+ */
77
+ export interface UpdateRegistryReader extends SourceOperations {
78
+ getBundleDetails(bundleId: string): Promise<Bundle>;
79
+ checkUpdates(): Promise<BundleUpdate[]>;
80
+ }
81
+ /**
82
+ * The read-only registry surface needed to detect raw version
83
+ * differences between each installed bundle and its source: resolve a
84
+ * bundle's latest details, list sources for cross-referencing, and read
85
+ * installation records (a single scope, or across scopes).
86
+ *
87
+ * Deliberately NOT `extends UpdateRegistryReader`/`SourceOperations`:
88
+ * `UpdateRegistryReader.checkUpdates` is exactly the method this port's
89
+ * consumer (`app`'s `detectBundleUpdates`) computes, so requiring it
90
+ * here would be self-referential, and raw update-detection never calls
91
+ * `syncSource`. The overlap with `getBundleDetails`/`listSources` is
92
+ * intentional, narrow, per-consumer duplication (interface segregation)
93
+ * rather than inheritance.
94
+ */
95
+ export interface UpdateDetectionReader {
96
+ getBundleDetails(bundleId: string): Promise<Bundle>;
97
+ listSources(): Promise<RegistrySource[]>;
98
+ getInstalledBundles(scope?: InstallationScope): Promise<InstalledBundle[]>;
99
+ getInstalledBundle(bundleId: string, scope: InstallationScope): Promise<InstalledBundle | undefined>;
100
+ }
101
+ /**
102
+ * CRUD access to the extension's local (non-hub) `Profile` records.
103
+ * Ported from `RegistryManager`'s direct use of its `RegistryStorage`
104
+ * facade's `getProfiles`/`addProfile`/`updateProfile`/`removeProfile` —
105
+ * needs a `core` port (rather than depending on the concrete storage
106
+ * class directly, the way `HubManager` depends on `infra`'s `HubStore`)
107
+ * because `RegistryStorage` is extension-owned with no `infra`
108
+ * counterpart.
109
+ */
110
+ export interface ProfileStore {
111
+ getProfiles(): Promise<Profile[]>;
112
+ addProfile(profile: Profile): Promise<void>;
113
+ updateProfile(profileId: string, updates: Partial<Profile>): Promise<void>;
114
+ removeProfile(profileId: string): Promise<void>;
115
+ }
116
+ /**
117
+ * Read-only view of hub-provided profiles, needed to merge them
118
+ * alongside local ones (`RegistryManager.listProfiles`/`isHubProfile`).
119
+ * Ported from the extension's `HubManager.listActiveHubProfiles`/
120
+ * `.listAllActiveProfiles` — extension-owned, no alternate
121
+ * implementation, hence a `core` port rather than a concrete class
122
+ * dependency.
123
+ */
124
+ export interface HubProfileReader {
125
+ listActiveHubProfiles(): Promise<HubProfileWithMetadata[]>;
126
+ listAllActiveProfiles(): Promise<ProfileActivationState[]>;
127
+ }
128
+ /**
129
+ * `HubProfileReader` plus the two mutating hub operations
130
+ * `RegistryManager.activateProfile`/`.deactivateProfile` delegate to
131
+ * when the target profile turns out to be hub-provided.
132
+ */
133
+ export interface HubProfileSync extends HubProfileReader {
134
+ activateProfile(hubId: string, profileId: string, options: {
135
+ installBundles: boolean;
136
+ }): Promise<unknown>;
137
+ deactivateProfile(hubId: string, profileId: string): Promise<unknown>;
138
+ }
139
+ /**
140
+ * Registry-wide operations needed to export/import the extension's
141
+ * complete settings (sources + profiles + configuration). `listSources`/
142
+ * `addSource` are deliberately narrow, opaque callbacks (mirroring
143
+ * `RegistryManager`'s own already-validating `addSource`, not raw
144
+ * storage) rather than a source-CRUD port, since import only ever adds.
145
+ * `getConfiguration`/`updateConfiguration` bridge the 3
146
+ * `promptregistry.*` VS Code settings `exportSettings`/`importSettings`
147
+ * read and write.
148
+ */
149
+ export interface RegistrySettingsOperations extends ProfileStore {
150
+ listSources(): Promise<RegistrySource[]>;
151
+ addSource(source: RegistrySource): Promise<void>;
152
+ /** Wipes all sources/profiles/caches — used only by the `'replace'` import strategy. */
153
+ clearAll(): Promise<void>;
154
+ getConfiguration(): ExportedSettingsConfiguration;
155
+ updateConfiguration(updates: ExportedSettingsConfiguration): Promise<void>;
156
+ }
157
+ //# sourceMappingURL=registry-operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-operations.d.ts","sourceRoot":"","sources":["../../src/ports/registry-operations.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=registry-operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-operations.js","sourceRoot":"","sources":["../../src/ports/registry-operations.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * ResourceTransformer port.
3
+ *
4
+ * Transforms file content before writing to a target to meet
5
+ * runtime-specific requirements (e.g., ensuring mandatory frontmatter
6
+ * fields for Kiro, adjusting formatting for VS Code, etc.).
7
+ *
8
+ * Implementations must be:
9
+ * - Idempotent: Applying the transformation multiple times yields the same result
10
+ * - Independent: Each transformation should not depend on other transformations
11
+ * - Fail-safe: On error, return the original content (log warning separately)
12
+ * @module ports/resource-transformer
13
+ */
14
+ import type { TransformContext, TransformResult } from '../domain/install/transform';
15
+ /**
16
+ * Transforms file content based on target type and file path.
17
+ * Implementations are registered per target type and applied
18
+ * during the write stage of the install pipeline.
19
+ */
20
+ export interface ResourceTransformer {
21
+ /**
22
+ * Transform file content based on target type and file path.
23
+ * @param context - Transformation context including target, file path, and original content.
24
+ * @returns TransformResult with transformed content and modification flag.
25
+ */
26
+ transform(context: TransformContext): TransformResult;
27
+ }
28
+ //# sourceMappingURL=resource-transformer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-transformer.d.ts","sourceRoot":"","sources":["../../src/ports/resource-transformer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAErC;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe,CAAC;CACvD"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=resource-transformer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-transformer.js","sourceRoot":"","sources":["../../src/ports/resource-transformer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Source adapter port.
3
+ *
4
+ * Mirrors `src/adapters/repository-adapter.ts`'s `IRepositoryAdapter`
5
+ * contract (see `src/adapters/AGENTS.md`) so that concrete adapters in
6
+ * `@ai-primitives-hub/infra` (Phase 3) can be implemented once and shared
7
+ * by both the CLI and, eventually, the extension (migration plan §6.3).
8
+ * @module ports/source-adapter
9
+ */
10
+ import type { Bundle } from '../domain/bundle/types';
11
+ import type { RegistrySource, SourceMetadata, ValidationResult } from '../domain/source/types';
12
+ /**
13
+ * Contract every source adapter (GitHub, Local, Awesome Copilot, APM,
14
+ * Skills, and their local variants) implements.
15
+ */
16
+ export interface SourceAdapter {
17
+ readonly type: string;
18
+ readonly source: RegistrySource;
19
+ fetchBundles(): Promise<Bundle[]>;
20
+ /**
21
+ * Download a bundle's archive.
22
+ * Always resolves to a `Buffer` — whether the source provides
23
+ * pre-packaged archives (GitHub) or builds them dynamically
24
+ * (Awesome Copilot, Local).
25
+ */
26
+ downloadBundle(bundle: Bundle): Promise<Buffer>;
27
+ fetchMetadata(): Promise<SourceMetadata>;
28
+ /** Returns validation details for user-facing diagnostics, not just a boolean. */
29
+ validate(): Promise<ValidationResult>;
30
+ requiresAuthentication(): boolean;
31
+ /** URL for UI display/debugging only — not used for the actual download. */
32
+ getManifestUrl(bundleId: string, version?: string): string;
33
+ /** URL for UI display/debugging only — not used for the actual download. */
34
+ getDownloadUrl(bundleId: string, version?: string): string;
35
+ /**
36
+ * Download a bundle's README text, if available.
37
+ * Returns `null` when no README is defined or the download fails.
38
+ */
39
+ downloadReadme(bundle: Bundle): Promise<string | null>;
40
+ /** Optional: force re-authentication (e.g. after a token expires). */
41
+ forceAuthentication?(): Promise<void>;
42
+ }
43
+ //# sourceMappingURL=source-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-adapter.d.ts","sourceRoot":"","sources":["../../src/ports/source-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EACV,MAAM,EACP,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAEhC,YAAY,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAElC;;;;;OAKG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhD,aAAa,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;IAEzC,kFAAkF;IAClF,QAAQ,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEtC,sBAAsB,IAAI,OAAO,CAAC;IAElC,4EAA4E;IAC5E,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE3D,4EAA4E;IAC5E,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE3D;;;OAGG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEvD,sEAAsE;IACtE,mBAAmB,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=source-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-adapter.js","sourceRoot":"","sources":["../../src/ports/source-adapter.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * SourceResolver port — resolves a `BundleSpec` to a downloadable
3
+ * `Installable`. Concrete adapters (GitHub resolver, awesome-copilot
4
+ * resolver, skills resolver, local resolver) live in `infra/resolvers`.
5
+ * @module ports/source-resolver
6
+ */
7
+ import type { BundleSpec, Installable } from '../domain/install/installable';
8
+ /**
9
+ * Resolves a parsed install specification to a downloadable bundle.
10
+ */
11
+ export interface BundleResolver {
12
+ /**
13
+ * Resolve a BundleSpec to an Installable.
14
+ * @param spec Parsed install positional.
15
+ * @returns Resolved Installable, or null when not found.
16
+ */
17
+ resolve(spec: BundleSpec): Promise<Installable | null>;
18
+ }
19
+ //# sourceMappingURL=source-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-resolver.d.ts","sourceRoot":"","sources":["../../src/ports/source-resolver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACZ,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CACxD"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=source-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-resolver.js","sourceRoot":"","sources":["../../src/ports/source-resolver.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * TargetWriter port — writes extracted bundle files into an install
3
+ * target (VS Code, Kiro, Windsurf, etc.). Concrete adapters live in
4
+ * `infra`/`app`. Repository-scope installations use a specialised
5
+ * writer that handles the `.github/` layout.
6
+ * @module ports/target-writer
7
+ */
8
+ import type { Target } from '../domain/install/target';
9
+ import type { ExtractedFiles } from './bundle-extractor';
10
+ /**
11
+ * Result of a write operation.
12
+ */
13
+ export interface TargetWriteResult {
14
+ /** Absolute paths of files written. */
15
+ written: string[];
16
+ /** Files in the bundle that were skipped (kind not allowed). */
17
+ skipped: string[];
18
+ }
19
+ /**
20
+ * Writes (and removes) bundle files in a target directory.
21
+ */
22
+ export interface TargetWriter {
23
+ /**
24
+ * Write the bundle into the target.
25
+ * @param target Target chosen via `--target <name>`.
26
+ * @param files Extracted bundle files.
27
+ * @returns TargetWriteResult.
28
+ */
29
+ write(target: Target, files: ExtractedFiles): Promise<TargetWriteResult>;
30
+ /**
31
+ * Remove a single file from the target.
32
+ * @param target Target chosen via `--target <name>`.
33
+ * @param filePath Relative file path to remove.
34
+ */
35
+ remove(target: Target, filePath: string): Promise<void>;
36
+ }
37
+ //# sourceMappingURL=target-writer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"target-writer.d.ts","sourceRoot":"","sources":["../../src/ports/target-writer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EACV,MAAM,EACP,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,cAAc,EACf,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,uCAAuC;IACvC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gEAAgE;IAChE,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEzE;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=target-writer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"target-writer.js","sourceRoot":"","sources":["../../src/ports/target-writer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Telemetry port interfaces.
3
+ *
4
+ * Defines the contract for telemetry documents and transports.
5
+ * Implementations in `@ai-primitives-hub/infra` handle delivery to
6
+ * specific backends (Elasticsearch, console, etc.).
7
+ * @module ports/telemetry
8
+ */
9
+ export interface TelemetryDocument {
10
+ timestamp: string;
11
+ eventName?: string;
12
+ error?: {
13
+ message: string;
14
+ stack?: string;
15
+ };
16
+ data?: Record<string, unknown>;
17
+ }
18
+ export interface TelemetryTransport {
19
+ send(doc: TelemetryDocument): void;
20
+ dispose(): void;
21
+ }
22
+ //# sourceMappingURL=telemetry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/ports/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,GAAG,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACnC,OAAO,IAAI,IAAI,CAAC;CACjB"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * Telemetry port interfaces.
4
+ *
5
+ * Defines the contract for telemetry documents and transports.
6
+ * Implementations in `@ai-primitives-hub/infra` handle delivery to
7
+ * specific backends (Elasticsearch, console, etc.).
8
+ * @module ports/telemetry
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ //# sourceMappingURL=telemetry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/ports/telemetry.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Update-outcome notification port — the narrow slice of the extension's
3
+ * `BundleUpdateNotifications` (`src/notifications/bundle-update-notifications.ts`)
4
+ * that the auto-update use case needs to report outcomes through. A CLI
5
+ * implementation would print to stdout instead of showing a VS Code
6
+ * notification; `BundleUpdateNotifications` already exposes exactly this
7
+ * shape, so it satisfies this port with zero changes.
8
+ * @module ports/update-notifier
9
+ */
10
+ /**
11
+ * Reports auto-update outcomes to the user, however the host chooses to
12
+ * surface them (VS Code notification, CLI stdout, ...).
13
+ */
14
+ export interface UpdateNotifier {
15
+ showAutoUpdateComplete(bundleId: string, previousVersion: string, targetVersion: string): Promise<void>;
16
+ showUpdateFailure(bundleId: string, error: string): Promise<void>;
17
+ showBatchUpdateSummary(successful: string[], failed: {
18
+ bundleId: string;
19
+ error: string;
20
+ }[]): Promise<void>;
21
+ }
22
+ //# sourceMappingURL=update-notifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-notifier.d.ts","sourceRoot":"","sources":["../../src/ports/update-notifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxG,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5G"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /**
3
+ * Update-outcome notification port — the narrow slice of the extension's
4
+ * `BundleUpdateNotifications` (`src/notifications/bundle-update-notifications.ts`)
5
+ * that the auto-update use case needs to report outcomes through. A CLI
6
+ * implementation would print to stdout instead of showing a VS Code
7
+ * notification; `BundleUpdateNotifications` already exposes exactly this
8
+ * shape, so it satisfies this port with zero changes.
9
+ * @module ports/update-notifier
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ //# sourceMappingURL=update-notifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-notifier.js","sourceRoot":"","sources":["../../src/ports/update-notifier.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG"}