veryfront 0.1.215 → 0.1.216

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 (162) hide show
  1. package/README.md +1 -1
  2. package/esm/cli/commands/extension/command-help.d.ts +3 -0
  3. package/esm/cli/commands/extension/command-help.d.ts.map +1 -0
  4. package/esm/cli/commands/extension/command-help.js +16 -0
  5. package/esm/cli/commands/extension/handler.d.ts +3 -0
  6. package/esm/cli/commands/extension/handler.d.ts.map +1 -0
  7. package/esm/cli/commands/extension/handler.js +36 -0
  8. package/esm/cli/commands/extension/init-command.d.ts +19 -0
  9. package/esm/cli/commands/extension/init-command.d.ts.map +1 -0
  10. package/esm/cli/commands/extension/init-command.js +122 -0
  11. package/esm/cli/commands/extension/validate-command.d.ts +13 -0
  12. package/esm/cli/commands/extension/validate-command.d.ts.map +1 -0
  13. package/esm/cli/commands/extension/validate-command.js +62 -0
  14. package/esm/cli/commands/knowledge/command.d.ts +1 -1
  15. package/esm/cli/commands/knowledge/command.d.ts.map +1 -1
  16. package/esm/cli/commands/knowledge/command.js +1 -2
  17. package/esm/cli/help/command-definitions.d.ts.map +1 -1
  18. package/esm/cli/help/command-definitions.js +2 -0
  19. package/esm/cli/router.d.ts.map +1 -1
  20. package/esm/cli/router.js +2 -0
  21. package/esm/deno.d.ts +3 -0
  22. package/esm/deno.js +4 -1
  23. package/esm/src/extensions/capabilities.d.ts +20 -0
  24. package/esm/src/extensions/capabilities.d.ts.map +1 -0
  25. package/esm/src/extensions/capabilities.js +77 -0
  26. package/esm/src/extensions/contracts.d.ts +10 -0
  27. package/esm/src/extensions/contracts.d.ts.map +1 -0
  28. package/esm/src/extensions/contracts.js +28 -0
  29. package/esm/src/extensions/discovery.d.ts +48 -0
  30. package/esm/src/extensions/discovery.d.ts.map +1 -0
  31. package/esm/src/extensions/discovery.js +179 -0
  32. package/esm/src/extensions/errors.d.ts +10 -0
  33. package/esm/src/extensions/errors.d.ts.map +1 -0
  34. package/esm/src/extensions/errors.js +34 -0
  35. package/esm/src/extensions/index.d.ts +21 -0
  36. package/esm/src/extensions/index.d.ts.map +1 -0
  37. package/esm/src/extensions/index.js +25 -0
  38. package/esm/src/extensions/interfaces/ai-model-provider.d.ts +94 -0
  39. package/esm/src/extensions/interfaces/ai-model-provider.d.ts.map +1 -0
  40. package/esm/src/extensions/interfaces/ai-model-provider.js +8 -0
  41. package/esm/src/extensions/interfaces/auth-provider.d.ts +49 -0
  42. package/esm/src/extensions/interfaces/auth-provider.d.ts.map +1 -0
  43. package/esm/src/extensions/interfaces/auth-provider.js +8 -0
  44. package/esm/src/extensions/interfaces/bundler.d.ts +118 -0
  45. package/esm/src/extensions/interfaces/bundler.d.ts.map +1 -0
  46. package/esm/src/extensions/interfaces/bundler.js +8 -0
  47. package/esm/src/extensions/interfaces/cache-store.d.ts +27 -0
  48. package/esm/src/extensions/interfaces/cache-store.d.ts.map +1 -0
  49. package/esm/src/extensions/interfaces/cache-store.js +8 -0
  50. package/esm/src/extensions/interfaces/code-parser.d.ts +76 -0
  51. package/esm/src/extensions/interfaces/code-parser.d.ts.map +1 -0
  52. package/esm/src/extensions/interfaces/code-parser.js +8 -0
  53. package/esm/src/extensions/interfaces/content-transformer.d.ts +40 -0
  54. package/esm/src/extensions/interfaces/content-transformer.d.ts.map +1 -0
  55. package/esm/src/extensions/interfaces/content-transformer.js +8 -0
  56. package/esm/src/extensions/interfaces/css-processor.d.ts +38 -0
  57. package/esm/src/extensions/interfaces/css-processor.d.ts.map +1 -0
  58. package/esm/src/extensions/interfaces/css-processor.js +8 -0
  59. package/esm/src/extensions/interfaces/database-client.d.ts +31 -0
  60. package/esm/src/extensions/interfaces/database-client.d.ts.map +1 -0
  61. package/esm/src/extensions/interfaces/database-client.js +8 -0
  62. package/esm/src/extensions/interfaces/embedding-provider.d.ts +37 -0
  63. package/esm/src/extensions/interfaces/embedding-provider.d.ts.map +1 -0
  64. package/esm/src/extensions/interfaces/embedding-provider.js +8 -0
  65. package/esm/src/extensions/interfaces/index.d.ts +21 -0
  66. package/esm/src/extensions/interfaces/index.d.ts.map +1 -0
  67. package/esm/src/extensions/interfaces/index.js +9 -0
  68. package/esm/src/extensions/interfaces/node-compat.d.ts +25 -0
  69. package/esm/src/extensions/interfaces/node-compat.d.ts.map +1 -0
  70. package/esm/src/extensions/interfaces/node-compat.js +8 -0
  71. package/esm/src/extensions/interfaces/schema-validator.d.ts +46 -0
  72. package/esm/src/extensions/interfaces/schema-validator.d.ts.map +1 -0
  73. package/esm/src/extensions/interfaces/schema-validator.js +8 -0
  74. package/esm/src/extensions/interfaces/tracing-exporter.d.ts +44 -0
  75. package/esm/src/extensions/interfaces/tracing-exporter.d.ts.map +1 -0
  76. package/esm/src/extensions/interfaces/tracing-exporter.js +8 -0
  77. package/esm/src/extensions/loader.d.ts +33 -0
  78. package/esm/src/extensions/loader.d.ts.map +1 -0
  79. package/esm/src/extensions/loader.js +209 -0
  80. package/esm/src/extensions/recommendations.d.ts +7 -0
  81. package/esm/src/extensions/recommendations.d.ts.map +1 -0
  82. package/esm/src/extensions/recommendations.js +22 -0
  83. package/esm/src/extensions/types.d.ts +47 -0
  84. package/esm/src/extensions/types.d.ts.map +1 -0
  85. package/esm/src/extensions/types.js +6 -0
  86. package/esm/src/extensions/validation.d.ts +44 -0
  87. package/esm/src/extensions/validation.d.ts.map +1 -0
  88. package/esm/src/extensions/validation.js +115 -0
  89. package/esm/src/platform/compat/process/command.d.ts +31 -0
  90. package/esm/src/platform/compat/process/command.d.ts.map +1 -0
  91. package/esm/src/platform/compat/process/command.js +193 -0
  92. package/esm/src/platform/compat/process/env.d.ts +31 -0
  93. package/esm/src/platform/compat/process/env.d.ts.map +1 -0
  94. package/esm/src/platform/compat/process/env.js +175 -0
  95. package/esm/src/platform/compat/process/lifecycle.d.ts +98 -0
  96. package/esm/src/platform/compat/process/lifecycle.d.ts.map +1 -0
  97. package/esm/src/platform/compat/process/lifecycle.js +305 -0
  98. package/esm/src/platform/compat/process/runtime-process.d.ts +10 -0
  99. package/esm/src/platform/compat/process/runtime-process.d.ts.map +1 -0
  100. package/esm/src/platform/compat/process/runtime-process.js +24 -0
  101. package/esm/src/platform/compat/process.d.ts +4 -165
  102. package/esm/src/platform/compat/process.d.ts.map +1 -1
  103. package/esm/src/platform/compat/process.js +4 -682
  104. package/esm/src/platform/index.d.ts +1 -1
  105. package/esm/src/platform/index.d.ts.map +1 -1
  106. package/esm/src/provider/runtime-loader/provider-endpoints.d.ts +8 -0
  107. package/esm/src/provider/runtime-loader/provider-endpoints.d.ts.map +1 -0
  108. package/esm/src/provider/runtime-loader/provider-endpoints.js +27 -0
  109. package/esm/src/provider/runtime-loader/provider-request-init.d.ts +32 -0
  110. package/esm/src/provider/runtime-loader/provider-request-init.d.ts.map +1 -0
  111. package/esm/src/provider/runtime-loader/provider-request-init.js +67 -0
  112. package/esm/src/provider/runtime-loader.d.ts.map +1 -1
  113. package/esm/src/provider/runtime-loader.js +90 -136
  114. package/esm/src/proxy/handler.d.ts.map +1 -1
  115. package/esm/src/proxy/handler.js +14 -0
  116. package/esm/src/server/utils/domain-parser.d.ts.map +1 -1
  117. package/esm/src/server/utils/domain-parser.js +4 -0
  118. package/esm/src/utils/version-constant.d.ts +1 -1
  119. package/esm/src/utils/version-constant.js +1 -1
  120. package/package.json +7 -1
  121. package/src/cli/commands/extension/command-help.ts +18 -0
  122. package/src/cli/commands/extension/handler.ts +41 -0
  123. package/src/cli/commands/extension/init-command.ts +140 -0
  124. package/src/cli/commands/extension/validate-command.ts +78 -0
  125. package/src/cli/commands/knowledge/command.ts +1 -2
  126. package/src/cli/help/command-definitions.ts +2 -0
  127. package/src/cli/router.ts +2 -0
  128. package/src/deno.js +4 -1
  129. package/src/src/extensions/capabilities.ts +97 -0
  130. package/src/src/extensions/contracts.ts +36 -0
  131. package/src/src/extensions/discovery.ts +221 -0
  132. package/src/src/extensions/errors.ts +39 -0
  133. package/src/src/extensions/index.ts +59 -0
  134. package/src/src/extensions/interfaces/ai-model-provider.ts +100 -0
  135. package/src/src/extensions/interfaces/auth-provider.ts +52 -0
  136. package/src/src/extensions/interfaces/bundler.ts +116 -0
  137. package/src/src/extensions/interfaces/cache-store.ts +27 -0
  138. package/src/src/extensions/interfaces/code-parser.ts +84 -0
  139. package/src/src/extensions/interfaces/content-transformer.ts +38 -0
  140. package/src/src/extensions/interfaces/css-processor.ts +40 -0
  141. package/src/src/extensions/interfaces/database-client.ts +35 -0
  142. package/src/src/extensions/interfaces/embedding-provider.ts +39 -0
  143. package/src/src/extensions/interfaces/index.ts +81 -0
  144. package/src/src/extensions/interfaces/node-compat.ts +25 -0
  145. package/src/src/extensions/interfaces/schema-validator.ts +51 -0
  146. package/src/src/extensions/interfaces/tracing-exporter.ts +42 -0
  147. package/src/src/extensions/loader.ts +245 -0
  148. package/src/src/extensions/recommendations.ts +24 -0
  149. package/src/src/extensions/types.ts +57 -0
  150. package/src/src/extensions/validation.ts +147 -0
  151. package/src/src/platform/compat/process/command.ts +297 -0
  152. package/src/src/platform/compat/process/env.ts +227 -0
  153. package/src/src/platform/compat/process/lifecycle.ts +330 -0
  154. package/src/src/platform/compat/process/runtime-process.ts +27 -0
  155. package/src/src/platform/compat/process.ts +37 -870
  156. package/src/src/platform/index.ts +1 -0
  157. package/src/src/provider/runtime-loader/provider-endpoints.ts +50 -0
  158. package/src/src/provider/runtime-loader/provider-request-init.ts +101 -0
  159. package/src/src/provider/runtime-loader.ts +107 -165
  160. package/src/src/proxy/handler.ts +16 -0
  161. package/src/src/server/utils/domain-parser.ts +4 -0
  162. package/src/src/utils/version-constant.ts +1 -1
@@ -0,0 +1,179 @@
1
+ /**
2
+ * Multi-source extension discovery.
3
+ *
4
+ * Discovers extensions from four sources with priority:
5
+ * config > package > project > local-file
6
+ *
7
+ * @module extensions/discovery
8
+ */
9
+ import * as dntShim from "../../_dnt.shims.js";
10
+ import { join } from "../../deps/jsr.io/@std/path/1.1.4/mod.js";
11
+ function isCapability(value) {
12
+ if (value === null || typeof value !== "object" || Array.isArray(value)) {
13
+ return false;
14
+ }
15
+ const cap = value;
16
+ return typeof cap.type === "string" && cap.type.length > 0;
17
+ }
18
+ /**
19
+ * Parse veryfront extension metadata from a package.json-like object.
20
+ *
21
+ * Returns `PackageMetadata` when the package declares
22
+ * `veryfront.extension: true`, otherwise `undefined`. Malformed capability
23
+ * entries are filtered out; the caller receives only valid shapes.
24
+ */
25
+ export function parsePackageMetadata(pkg) {
26
+ const vf = pkg.veryfront;
27
+ if (vf === null || vf === undefined || typeof vf !== "object" ||
28
+ Array.isArray(vf)) {
29
+ return undefined;
30
+ }
31
+ const meta = vf;
32
+ if (meta.extension !== true) {
33
+ return undefined;
34
+ }
35
+ const capabilities = Array.isArray(meta.capabilities)
36
+ ? meta.capabilities.filter(isCapability)
37
+ : [];
38
+ return { isExtension: true, capabilities };
39
+ }
40
+ /**
41
+ * Merge extensions from all four sources in priority order.
42
+ *
43
+ * Priority (highest first): config > package > project > local-file.
44
+ * Duplicates are resolved by keeping the highest-priority entry.
45
+ * Disable directives (`{ name, enabled: false }`) remove matching
46
+ * extensions regardless of source.
47
+ */
48
+ export function mergeExtensions(config, packages, project, local, disableDirectives) {
49
+ const disabledNames = new Set((disableDirectives ?? []).map((d) => d.name));
50
+ const seen = new Map();
51
+ // Process sources in priority order -- first write wins.
52
+ const ordered = [
53
+ ...config,
54
+ ...packages,
55
+ ...project,
56
+ ...local,
57
+ ];
58
+ for (const resolved of ordered) {
59
+ const name = resolved.extension.name;
60
+ if (disabledNames.has(name))
61
+ continue;
62
+ if (!seen.has(name)) {
63
+ seen.set(name, resolved);
64
+ }
65
+ }
66
+ return [...seen.values()];
67
+ }
68
+ // ---------------------------------------------------------------------------
69
+ // Filesystem discovery helpers
70
+ // ---------------------------------------------------------------------------
71
+ async function readDir(path) {
72
+ try {
73
+ const entries = [];
74
+ for await (const entry of dntShim.Deno.readDir(path)) {
75
+ entries.push(entry);
76
+ }
77
+ return entries;
78
+ }
79
+ catch (err) {
80
+ if (err instanceof dntShim.Deno.errors.NotFound)
81
+ return [];
82
+ throw err;
83
+ }
84
+ }
85
+ async function fileExists(path) {
86
+ try {
87
+ await dntShim.Deno.stat(path);
88
+ return true;
89
+ }
90
+ catch (err) {
91
+ if (err instanceof dntShim.Deno.errors.NotFound)
92
+ return false;
93
+ throw err;
94
+ }
95
+ }
96
+ /**
97
+ * Scan `node_modules` (including `@scoped` packages) for packages
98
+ * that declare veryfront extension metadata in their `package.json`.
99
+ */
100
+ export async function discoverPackageExtensions(baseDir) {
101
+ const nmDir = join(baseDir, "node_modules");
102
+ const results = [];
103
+ const entries = await readDir(nmDir);
104
+ for (const entry of entries) {
105
+ // Accept symlinks so pnpm-style node_modules layouts are discovered.
106
+ if (!entry.isDirectory && !entry.isSymlink)
107
+ continue;
108
+ if (entry.name.startsWith("@")) {
109
+ // Scoped packages -- iterate one level deeper.
110
+ const scopeDir = join(nmDir, entry.name);
111
+ const scopeEntries = await readDir(scopeDir);
112
+ for (const scopeEntry of scopeEntries) {
113
+ if (!scopeEntry.isDirectory && !scopeEntry.isSymlink)
114
+ continue;
115
+ const pkgName = `${entry.name}/${scopeEntry.name}`;
116
+ const meta = await tryReadPackageMeta(join(scopeDir, scopeEntry.name));
117
+ if (meta)
118
+ results.push({ packageName: pkgName, metadata: meta });
119
+ }
120
+ }
121
+ else {
122
+ const meta = await tryReadPackageMeta(join(nmDir, entry.name));
123
+ if (meta)
124
+ results.push({ packageName: entry.name, metadata: meta });
125
+ }
126
+ }
127
+ return results;
128
+ }
129
+ async function tryReadPackageMeta(pkgDir) {
130
+ let raw;
131
+ try {
132
+ raw = await dntShim.Deno.readTextFile(join(pkgDir, "package.json"));
133
+ }
134
+ catch (err) {
135
+ if (err instanceof dntShim.Deno.errors.NotFound)
136
+ return undefined;
137
+ throw err;
138
+ }
139
+ try {
140
+ const pkg = JSON.parse(raw);
141
+ return parsePackageMetadata(pkg);
142
+ }
143
+ catch {
144
+ // Malformed JSON -- treat as non-extension package.
145
+ return undefined;
146
+ }
147
+ }
148
+ /**
149
+ * Discover project extensions living under `extensions/` in the project root.
150
+ *
151
+ * Looks for `extensions/<name>/src/index.ts` and `extensions/<name>/index.ts`.
152
+ */
153
+ export async function discoverProjectExtensions(baseDir) {
154
+ const extDir = join(baseDir, "extensions");
155
+ const entries = await readDir(extDir);
156
+ const results = [];
157
+ for (const entry of entries) {
158
+ if (!entry.isDirectory)
159
+ continue;
160
+ const srcIndex = join(extDir, entry.name, "src", "index.ts");
161
+ const rootIndex = join(extDir, entry.name, "index.ts");
162
+ if (await fileExists(srcIndex)) {
163
+ results.push(srcIndex);
164
+ }
165
+ else if (await fileExists(rootIndex)) {
166
+ results.push(rootIndex);
167
+ }
168
+ }
169
+ return results;
170
+ }
171
+ /**
172
+ * Find `*.extension.ts` files in the project root.
173
+ */
174
+ export async function discoverLocalExtensions(baseDir) {
175
+ const entries = await readDir(baseDir);
176
+ return entries
177
+ .filter((e) => !e.isDirectory && e.name.endsWith(".extension.ts"))
178
+ .map((e) => join(baseDir, e.name));
179
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Extension system error definitions.
3
+ *
4
+ * @module extensions/errors
5
+ */
6
+ export declare const MISSING_EXTENSION_ERROR: import("../errors/types.js").RegisteredError;
7
+ export declare const EXTENSION_VALIDATION_ERROR: import("../errors/types.js").RegisteredError;
8
+ export declare const CIRCULAR_DEPENDENCY_ERROR: import("../errors/types.js").RegisteredError;
9
+ export declare const EXTENSION_CONFLICT_ERROR: import("../errors/types.js").RegisteredError;
10
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/src/extensions/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,uBAAuB,8CAMlC,CAAC;AAEH,eAAO,MAAM,0BAA0B,8CAMrC,CAAC;AAEH,eAAO,MAAM,yBAAyB,8CAMpC,CAAC;AAEH,eAAO,MAAM,wBAAwB,8CAMnC,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Extension system error definitions.
3
+ *
4
+ * @module extensions/errors
5
+ */
6
+ import { defineError } from "../errors/index.js";
7
+ export const MISSING_EXTENSION_ERROR = defineError({
8
+ slug: "missing-extension",
9
+ category: "RUNTIME",
10
+ status: 500,
11
+ title: "Required extension not found",
12
+ suggestion: "Install the missing extension package and add it to your configuration",
13
+ });
14
+ export const EXTENSION_VALIDATION_ERROR = defineError({
15
+ slug: "extension-validation",
16
+ category: "CONFIG",
17
+ status: 422,
18
+ title: "Extension validation failed",
19
+ suggestion: "Check that the extension exports a valid name, version, and capabilities array",
20
+ });
21
+ export const CIRCULAR_DEPENDENCY_ERROR = defineError({
22
+ slug: "extension-circular-dependency",
23
+ category: "CONFIG",
24
+ status: 422,
25
+ title: "Circular dependency detected between extensions",
26
+ suggestion: "Review the 'extends' fields in your extensions to break the cycle",
27
+ });
28
+ export const EXTENSION_CONFLICT_ERROR = defineError({
29
+ slug: "extension-conflict",
30
+ category: "CONFIG",
31
+ status: 409,
32
+ title: "Conflicting extensions detected",
33
+ suggestion: "Remove or disable one of the conflicting extensions in your configuration",
34
+ });
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Public extension API surface.
3
+ *
4
+ * Types used when authoring extensions (the scaffold template generated by
5
+ * `veryfront extension init` imports from this module), plus the runtime
6
+ * helpers consumers need to load, validate, and orchestrate extensions.
7
+ *
8
+ * @module extensions
9
+ */
10
+ import "../../_dnt.polyfills.js";
11
+ export type { Capability, Extension, ExtensionConfigEntry, ExtensionContext, ExtensionFactory, ExtensionLogger, ExtensionSource, ResolvedExtension, } from "./types.js";
12
+ export { resolve, tryResolve } from "./contracts.js";
13
+ export type { PackageMetadata } from "./discovery.js";
14
+ export { discoverLocalExtensions, discoverPackageExtensions, discoverProjectExtensions, mergeExtensions, parsePackageMetadata, } from "./discovery.js";
15
+ export { ExtensionLoader } from "./loader.js";
16
+ export type { ConflictInfo } from "./validation.js";
17
+ export { detectConflicts, validateExtension } from "./validation.js";
18
+ export { auditCapabilities, formatCapabilities, mapToDenoPermissions } from "./capabilities.js";
19
+ export { getRecommendation } from "./recommendations.js";
20
+ export { CIRCULAR_DEPENDENCY_ERROR, EXTENSION_CONFLICT_ERROR, EXTENSION_VALIDATION_ERROR, MISSING_EXTENSION_ERROR, } from "./errors.js";
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/extensions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,yBAAyB,CAAC;AAEjC,YAAY,EACV,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGrD,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,eAAe,EACf,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGhG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Public extension API surface.
3
+ *
4
+ * Types used when authoring extensions (the scaffold template generated by
5
+ * `veryfront extension init` imports from this module), plus the runtime
6
+ * helpers consumers need to load, validate, and orchestrate extensions.
7
+ *
8
+ * @module extensions
9
+ */
10
+ // Core types
11
+ import "../../_dnt.polyfills.js";
12
+ // Contract registry — resolve/tryResolve are the consumer-facing API.
13
+ // register()/reset() are internal primitives (used by ExtensionLoader and
14
+ // tests) and are intentionally not exported here.
15
+ export { resolve, tryResolve } from "./contracts.js";
16
+ export { discoverLocalExtensions, discoverPackageExtensions, discoverProjectExtensions, mergeExtensions, parsePackageMetadata, } from "./discovery.js";
17
+ // Loader
18
+ export { ExtensionLoader } from "./loader.js";
19
+ export { detectConflicts, validateExtension } from "./validation.js";
20
+ // Capabilities
21
+ export { auditCapabilities, formatCapabilities, mapToDenoPermissions } from "./capabilities.js";
22
+ // Recommendations
23
+ export { getRecommendation } from "./recommendations.js";
24
+ // Errors
25
+ export { CIRCULAR_DEPENDENCY_ERROR, EXTENSION_CONFLICT_ERROR, EXTENSION_VALIDATION_ERROR, MISSING_EXTENSION_ERROR, } from "./errors.js";
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Contract interface for AI/LLM model providers.
3
+ *
4
+ * Default implementation: `@veryfront/ext-openai`
5
+ *
6
+ * @module extensions/interfaces/ai-model-provider
7
+ */
8
+ /** A single part of a multi-modal message (text or image). */
9
+ export interface ContentPart {
10
+ /** Part type. */
11
+ type: "text" | "image";
12
+ /** Text content (when `type` is `"text"`). */
13
+ text?: string;
14
+ /** Image URL or base64 data (when `type` is `"image"`). */
15
+ imageUrl?: string;
16
+ }
17
+ /** A chat message in a conversation. */
18
+ export interface ChatMessage {
19
+ /** Message role. */
20
+ role: "system" | "user" | "assistant" | "tool";
21
+ /** Simple text content. */
22
+ content?: string;
23
+ /** Multi-modal content parts (used instead of `content`). */
24
+ parts?: ContentPart[];
25
+ /** Tool call ID this message responds to (for `tool` role). */
26
+ toolCallId?: string;
27
+ }
28
+ /** Definition of a tool the model may invoke. */
29
+ export interface ToolDefinition {
30
+ /** Tool name. */
31
+ name: string;
32
+ /** Human-readable description of what the tool does. */
33
+ description: string;
34
+ /** JSON Schema describing the tool's parameters. */
35
+ parameters: Record<string, unknown>;
36
+ }
37
+ /** Options passed to {@link AIModelProvider.complete} and {@link AIModelProvider.stream}. */
38
+ export interface CompletionOptions {
39
+ /** Model identifier (e.g. `"gpt-4o"`, `"claude-sonnet-4-20250514"`). */
40
+ model: string;
41
+ /** Conversation messages. */
42
+ messages: ChatMessage[];
43
+ /** Sampling temperature. */
44
+ temperature?: number;
45
+ /** Maximum tokens to generate. */
46
+ maxTokens?: number;
47
+ /** Available tools for function calling. */
48
+ tools?: ToolDefinition[];
49
+ /** Additional provider-specific options. */
50
+ [key: string]: unknown;
51
+ }
52
+ /** Result returned from {@link AIModelProvider.complete}. */
53
+ export interface CompletionResult {
54
+ /** Generated text content. */
55
+ content: string;
56
+ /** Tool calls requested by the model, if any. */
57
+ toolCalls?: Array<{
58
+ id: string;
59
+ name: string;
60
+ arguments: string;
61
+ }>;
62
+ /** Token usage statistics. */
63
+ usage?: {
64
+ promptTokens: number;
65
+ completionTokens: number;
66
+ totalTokens: number;
67
+ };
68
+ }
69
+ /** A chunk emitted during streaming completion. */
70
+ export interface StreamChunk {
71
+ /** Incremental text delta. */
72
+ content?: string;
73
+ /** Incremental tool call delta. */
74
+ toolCallDelta?: {
75
+ id?: string;
76
+ name?: string;
77
+ arguments?: string;
78
+ };
79
+ /** Whether this is the final chunk. */
80
+ done: boolean;
81
+ }
82
+ /**
83
+ * AIModelProvider contract interface.
84
+ *
85
+ * Implementations provide chat completion and streaming capabilities
86
+ * against large language models.
87
+ */
88
+ export interface AIModelProvider {
89
+ /** Generate a complete response for the given conversation. */
90
+ complete(options: CompletionOptions): Promise<CompletionResult>;
91
+ /** Stream a response token-by-token. */
92
+ stream(options: CompletionOptions): AsyncIterable<StreamChunk>;
93
+ }
94
+ //# sourceMappingURL=ai-model-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-model-provider.d.ts","sourceRoot":"","sources":["../../../../src/src/extensions/interfaces/ai-model-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,8DAA8D;AAC9D,MAAM,WAAW,WAAW;IAC1B,iBAAiB;IACjB,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wCAAwC;AACxC,MAAM,WAAW,WAAW;IAC1B,oBAAoB;IACpB,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAC/C,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IACtB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,iDAAiD;AACjD,MAAM,WAAW,cAAc;IAC7B,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,6FAA6F;AAC7F,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,4CAA4C;IAC5C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,6DAA6D;AAC7D,MAAM,WAAW,gBAAgB;IAC/B,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,SAAS,CAAC,EAAE,KAAK,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,8BAA8B;IAC9B,KAAK,CAAC,EAAE;QACN,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;QACzB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,mDAAmD;AACnD,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,aAAa,CAAC,EAAE;QACd,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,uCAAuC;IACvC,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAChE,wCAAwC;IACxC,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;CAChE"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Contract interface for AI/LLM model providers.
3
+ *
4
+ * Default implementation: `@veryfront/ext-openai`
5
+ *
6
+ * @module extensions/interfaces/ai-model-provider
7
+ */
8
+ export {};
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Contract interface for authentication token providers.
3
+ *
4
+ * Default implementation: `@veryfront/ext-jwt`
5
+ *
6
+ * @module extensions/interfaces/auth-provider
7
+ */
8
+ /** Payload data stored within a signed token. */
9
+ export interface TokenPayload {
10
+ /** Subject identifier (typically a user ID). */
11
+ sub: string;
12
+ /** Expiration time as a Unix timestamp (seconds). */
13
+ exp?: number;
14
+ /** Issued-at time as a Unix timestamp (seconds). */
15
+ iat?: number;
16
+ /** Additional claims. */
17
+ [key: string]: unknown;
18
+ }
19
+ /** Options for signing a token. */
20
+ export interface SignOptions {
21
+ /** Token lifetime (e.g. `"1h"`, `"7d"`, or seconds as a number). */
22
+ expiresIn?: string | number;
23
+ /** Signing algorithm (e.g. `"HS256"`, `"RS256"`). */
24
+ algorithm?: string;
25
+ /** Additional implementation-specific options. */
26
+ [key: string]: unknown;
27
+ }
28
+ /** Options for verifying a token. */
29
+ export interface VerifyOptions {
30
+ /** Expected algorithms to accept. */
31
+ algorithms?: string[];
32
+ /** Additional implementation-specific options. */
33
+ [key: string]: unknown;
34
+ }
35
+ /**
36
+ * AuthProvider contract interface.
37
+ *
38
+ * Implementations sign, verify, and decode authentication tokens
39
+ * (e.g. JWTs) for request authentication.
40
+ */
41
+ export interface AuthProvider {
42
+ /** Sign a payload into a token string. */
43
+ sign(payload: TokenPayload, options?: SignOptions): Promise<string>;
44
+ /** Verify a token and return its decoded payload. Throws on invalid tokens. */
45
+ verify(token: string, options?: VerifyOptions): Promise<TokenPayload>;
46
+ /** Decode a token without verifying its signature. */
47
+ decode(token: string): TokenPayload | undefined;
48
+ }
49
+ //# sourceMappingURL=auth-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-provider.d.ts","sourceRoot":"","sources":["../../../../src/src/extensions/interfaces/auth-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,iDAAiD;AACjD,MAAM,WAAW,YAAY;IAC3B,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,mCAAmC;AACnC,MAAM,WAAW,WAAW;IAC1B,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,kDAAkD;IAClD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpE,+EAA+E;IAC/E,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACtE,sDAAsD;IACtD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;CACjD"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Contract interface for authentication token providers.
3
+ *
4
+ * Default implementation: `@veryfront/ext-jwt`
5
+ *
6
+ * @module extensions/interfaces/auth-provider
7
+ */
8
+ export {};
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Contract interface for module bundlers.
3
+ *
4
+ * Default implementation: `@veryfront/ext-esbuild`
5
+ *
6
+ * @module extensions/interfaces/bundler
7
+ */
8
+ /** Options passed to {@link Bundler.bundle}. */
9
+ export interface BundleOptions {
10
+ /** Entry point file paths. */
11
+ entryPoints: string[];
12
+ /** Output directory. */
13
+ outdir: string;
14
+ /** Bundle format (`esm`, `cjs`, `iife`). */
15
+ format?: "esm" | "cjs" | "iife";
16
+ /** Target environment(s). */
17
+ target?: string | string[];
18
+ /** Enable minification. */
19
+ minify?: boolean;
20
+ /** Enable source maps. */
21
+ sourcemap?: boolean | "inline" | "external";
22
+ /** Enable code splitting. */
23
+ splitting?: boolean;
24
+ /** Additional plugins. */
25
+ plugins?: BundlerPlugin[];
26
+ /** Extra implementation-specific options. */
27
+ [key: string]: unknown;
28
+ }
29
+ /** A single output file produced by a bundle operation. */
30
+ export interface BundleOutput {
31
+ /** Absolute path to the output file. */
32
+ path: string;
33
+ /** Raw byte content. */
34
+ contents: Uint8Array;
35
+ }
36
+ /** Result returned from {@link Bundler.bundle}. */
37
+ export interface BundleResult {
38
+ /** Output files produced by the bundle. */
39
+ outputs: BundleOutput[];
40
+ /** Warnings emitted during bundling. */
41
+ warnings: string[];
42
+ /** Errors encountered during bundling. */
43
+ errors: string[];
44
+ }
45
+ /** Options passed to {@link Bundler.transform}. */
46
+ export interface TransformOptions {
47
+ /** Source code to transform. */
48
+ code: string;
49
+ /** Loader hint (`ts`, `tsx`, `jsx`, `css`, etc.). */
50
+ loader?: string;
51
+ /** Output format. */
52
+ format?: "esm" | "cjs" | "iife";
53
+ /** Target environment(s). */
54
+ target?: string | string[];
55
+ /** Enable minification. */
56
+ minify?: boolean;
57
+ /** Enable source maps. */
58
+ sourcemap?: boolean | "inline" | "external";
59
+ /** Extra implementation-specific options. */
60
+ [key: string]: unknown;
61
+ }
62
+ /** Result returned from {@link Bundler.transform}. */
63
+ export interface TransformResult {
64
+ /** Transformed source code. */
65
+ code: string;
66
+ /** Source map, if requested. */
67
+ map?: string;
68
+ /** Warnings emitted during transformation. */
69
+ warnings: string[];
70
+ }
71
+ /** Build context exposed to bundler plugins. */
72
+ export interface BundlerPluginBuild {
73
+ /** Register a resolver callback for the given filter. */
74
+ onResolve(options: {
75
+ filter: RegExp;
76
+ namespace?: string;
77
+ }, callback: (args: {
78
+ path: string;
79
+ namespace: string;
80
+ }) => {
81
+ path?: string;
82
+ namespace?: string;
83
+ external?: boolean;
84
+ } | undefined): void;
85
+ /** Register a loader callback for the given filter. */
86
+ onLoad(options: {
87
+ filter: RegExp;
88
+ namespace?: string;
89
+ }, callback: (args: {
90
+ path: string;
91
+ namespace: string;
92
+ }) => {
93
+ contents?: string;
94
+ loader?: string;
95
+ } | undefined): void;
96
+ }
97
+ /** A bundler plugin that hooks into the build pipeline. */
98
+ export interface BundlerPlugin {
99
+ /** Unique plugin name. */
100
+ name: string;
101
+ /** Called once when the plugin is registered. */
102
+ setup(build: BundlerPluginBuild): void;
103
+ }
104
+ /**
105
+ * Bundler contract interface.
106
+ *
107
+ * Implementations compile and bundle application source code into
108
+ * optimized output suitable for deployment or development.
109
+ */
110
+ export interface Bundler {
111
+ /** Bundle one or more entry points into output files. */
112
+ bundle(options: BundleOptions): Promise<BundleResult>;
113
+ /** Transform a single source string without writing to disk. */
114
+ transform(options: TransformOptions): Promise<TransformResult>;
115
+ /** Release bundler resources (child processes, watchers, etc.). */
116
+ stop?(): Promise<void>;
117
+ }
118
+ //# sourceMappingURL=bundler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../../../src/src/extensions/interfaces/bundler.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAChC,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,2BAA2B;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC5C,6BAA6B;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,6CAA6C;IAC7C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,2DAA2D;AAC3D,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,QAAQ,EAAE,UAAU,CAAC;CACtB;AAED,mDAAmD;AACnD,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,wCAAwC;IACxC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,0CAA0C;IAC1C,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,mDAAmD;AACnD,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qBAAqB;IACrB,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAChC,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,2BAA2B;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC5C,6CAA6C;IAC7C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,sDAAsD;AACtD,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,gDAAgD;AAChD,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,SAAS,CACP,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,EAC/C,QAAQ,EAAE,CACR,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KACtC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,GACzE,IAAI,CAAC;IACR,uDAAuD;IACvD,MAAM,CACJ,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,EAC/C,QAAQ,EAAE,CACR,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KACtC;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,GACtD,IAAI,CAAC;CACT;AAED,2DAA2D;AAC3D,MAAM,WAAW,aAAa;IAC5B,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,KAAK,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,yDAAyD;IACzD,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACtD,gEAAgE;IAChE,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/D,mEAAmE;IACnE,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Contract interface for module bundlers.
3
+ *
4
+ * Default implementation: `@veryfront/ext-esbuild`
5
+ *
6
+ * @module extensions/interfaces/bundler
7
+ */
8
+ export {};
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Contract interface for key-value cache stores.
3
+ *
4
+ * Default implementation: `@veryfront/ext-redis`
5
+ *
6
+ * @module extensions/interfaces/cache-store
7
+ */
8
+ /**
9
+ * CacheStore contract interface.
10
+ *
11
+ * Implementations provide key-value caching with optional TTL support.
12
+ */
13
+ export interface CacheStore {
14
+ /** Retrieve a cached value by key. Returns `undefined` on miss. */
15
+ get<T = unknown>(key: string): Promise<T | undefined>;
16
+ /** Store a value under the given key with an optional TTL in seconds. */
17
+ set<T = unknown>(key: string, value: T, ttl?: number): Promise<void>;
18
+ /** Delete a cached entry. */
19
+ delete(key: string): Promise<void>;
20
+ /** Check whether a key exists in the cache. */
21
+ has(key: string): Promise<boolean>;
22
+ /** Remove all entries from the cache. */
23
+ clear(): Promise<void>;
24
+ /** Close connections and release resources. */
25
+ disconnect?(): Promise<void>;
26
+ }
27
+ //# sourceMappingURL=cache-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-store.d.ts","sourceRoot":"","sources":["../../../../src/src/extensions/interfaces/cache-store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,mEAAmE;IACnE,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IACtD,yEAAyE;IACzE,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,6BAA6B;IAC7B,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,+CAA+C;IAC/C,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,yCAAyC;IACzC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,+CAA+C;IAC/C,UAAU,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Contract interface for key-value cache stores.
3
+ *
4
+ * Default implementation: `@veryfront/ext-redis`
5
+ *
6
+ * @module extensions/interfaces/cache-store
7
+ */
8
+ export {};