@happyvertical/smrt-core 0.43.10 → 0.44.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/AGENTS.md +8 -8
- package/agents/generators.md +104 -0
- package/agents/revision-guard.md +66 -0
- package/agents/schema-paths.md +99 -0
- package/dist/cascade.d.ts +5 -9
- package/dist/cascade.d.ts.map +1 -1
- package/dist/cascade.js +65 -30
- package/dist/cascade.js.map +1 -1
- package/dist/embedded-write-queue.d.ts +8 -0
- package/dist/embedded-write-queue.d.ts.map +1 -1
- package/dist/embedded-write-queue.js +12 -2
- package/dist/embedded-write-queue.js.map +1 -1
- package/dist/generators/custom-action.d.ts.map +1 -1
- package/dist/generators/custom-action.js +1 -1
- package/dist/generators/custom-action.js.map +1 -1
- package/dist/generators/index.d.ts +1 -0
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +2 -1
- package/dist/generators/preflight-route.d.ts +151 -0
- package/dist/generators/preflight-route.d.ts.map +1 -0
- package/dist/generators/preflight-route.js +194 -0
- package/dist/generators/preflight-route.js.map +1 -0
- package/dist/generators/rest.d.ts +12 -0
- package/dist/generators/rest.d.ts.map +1 -1
- package/dist/generators/rest.js +12 -15
- package/dist/generators/rest.js.map +1 -1
- package/dist/generators.js +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/knowledge.d.ts +17 -1
- package/dist/knowledge.d.ts.map +1 -1
- package/dist/knowledge.js +33 -3
- package/dist/knowledge.js.map +1 -1
- package/dist/manifest/static-manifest.d.ts.map +1 -1
- package/dist/manifest/static-manifest.js +6 -2
- package/dist/manifest/static-manifest.js.map +1 -1
- package/dist/manifest/store.js +1 -1
- package/dist/manifest/store.js.map +1 -1
- package/dist/manifest.json +8 -2
- package/dist/migrations/differ.d.ts +49 -0
- package/dist/migrations/differ.d.ts.map +1 -1
- package/dist/migrations/differ.js +220 -4
- package/dist/migrations/differ.js.map +1 -1
- package/dist/migrations/orchestrate.d.ts +23 -0
- package/dist/migrations/orchestrate.d.ts.map +1 -1
- package/dist/migrations/orchestrate.js +12 -3
- package/dist/migrations/orchestrate.js.map +1 -1
- package/dist/object.d.ts +31 -1
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +57 -9
- package/dist/object.js.map +1 -1
- package/dist/registry/types.d.ts +8 -3
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/revision-guard.d.ts +84 -0
- package/dist/revision-guard.d.ts.map +1 -0
- package/dist/revision-guard.js +120 -0
- package/dist/revision-guard.js.map +1 -0
- package/dist/schema/foreign-key-ddl.d.ts +7 -0
- package/dist/schema/foreign-key-ddl.d.ts.map +1 -1
- package/dist/schema/foreign-key-ddl.js +7 -1
- package/dist/schema/foreign-key-ddl.js.map +1 -1
- package/dist/schema/schema-manager.d.ts +15 -0
- package/dist/schema/schema-manager.d.ts.map +1 -1
- package/dist/schema/schema-manager.js +52 -9
- package/dist/schema/schema-manager.js.map +1 -1
- package/dist/schema/types.d.ts +10 -0
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/uuid-convergence.d.ts +142 -0
- package/dist/schema/uuid-convergence.d.ts.map +1 -0
- package/dist/schema/uuid-convergence.js +0 -0
- package/dist/schema/uuid-convergence.js.map +1 -0
- package/dist/smrt-knowledge.json +18 -9
- package/dist/utils/scanner-module.d.ts +44 -0
- package/dist/utils/scanner-module.d.ts.map +1 -1
- package/dist/vite-plugin/index.d.ts +14 -1
- package/dist/vite-plugin/index.d.ts.map +1 -1
- package/dist/vite-plugin/index.js +54 -2
- package/dist/vite-plugin/index.js.map +1 -1
- package/dist/vite-plugin.js +3 -2
- package/package.json +4 -4
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { DomainKnowledgeConfig } from '@happyvertical/smrt-types';
|
|
1
|
+
import { DomainKnowledgeAgentSurface, DomainKnowledgeConfig } from '@happyvertical/smrt-types';
|
|
2
2
|
import { Plugin } from 'vite';
|
|
3
3
|
import { SmrtGenerationSnapshotOptions } from '../generation-snapshot.js';
|
|
4
4
|
import { SmartObjectManifest } from '../scanner/types.js';
|
|
5
|
+
import { ScannerAgentSurface } from '../utils/scanner-module.js';
|
|
5
6
|
export { loadVerifiedSmrtGenerationSnapshot, type SerializeSmrtGenerationSnapshotOptions, type SmrtGenerationSnapshotArtifact, type SmrtGenerationSnapshotOptions, type SmrtGenerationSnapshotView, serializeSmrtGenerationSnapshot, sha256SmrtGenerationSnapshot, } from '../generation-snapshot.js';
|
|
6
7
|
export type { CliApiCoherenceViolation, SvelteKitOptions, } from './sveltekit-generator.js';
|
|
7
8
|
export { findCliApiCoherenceViolations, generateSvelteKitRoutes, methodNameToKebab, resolveApiActionRouteConfig, resolveApiActionSet, validateCliIncludeAgainstApi, } from './sveltekit-generator.js';
|
|
9
|
+
export { buildWebMcpToolDefinitions } from './web-collections.js';
|
|
8
10
|
export interface SmrtPluginOptions {
|
|
9
11
|
/** Root directory that owns generated manifests and SvelteKit routes. */
|
|
10
12
|
projectRoot?: string;
|
|
@@ -89,6 +91,17 @@ export interface SmrtPluginOptions {
|
|
|
89
91
|
*/
|
|
90
92
|
validateCliApiCoherence?: boolean;
|
|
91
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Project a scanner agent surface into the knowledge-artifact shape (#2591).
|
|
96
|
+
*
|
|
97
|
+
* The two shapes are deliberately separate: the scanner cannot depend on
|
|
98
|
+
* `@happyvertical/smrt-types` (core depends on the scanner, and importing back
|
|
99
|
+
* would close the cycle), so it mirrors the vocabulary structurally and this
|
|
100
|
+
* function is the one place the mirror is reconciled. `filePath` becomes
|
|
101
|
+
* `sourceFile` here because the artifact records a package-relative path, not a
|
|
102
|
+
* scan path.
|
|
103
|
+
*/
|
|
104
|
+
export declare function toKnowledgeAgentSurface(surface: ScannerAgentSurface | undefined): DomainKnowledgeAgentSurface | undefined;
|
|
92
105
|
export declare function isRegisterShimModuleId(id: string): boolean;
|
|
93
106
|
/**
|
|
94
107
|
* Generate the replacement `__smrt-register__` module with the build-time
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite-plugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EACV,qBAAqB,EAEtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAiC,MAAM,MAAM,CAAC;AAClE,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite-plugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EACV,2BAA2B,EAC3B,qBAAqB,EAEtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAiC,MAAM,MAAM,CAAC;AAClE,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EACV,mBAAmB,EAEpB,MAAM,4BAA4B,CAAC;AAyBpC,OAAO,EACL,kCAAkC,EAClC,KAAK,sCAAsC,EAC3C,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,+BAA+B,EAC/B,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,iBAAiB,EACjB,2BAA2B,EAC3B,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAalE,MAAM,WAAW,iBAAiB;I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E,OAAO,CAAC,EAAE,OAAO,CAAC;YAAC,cAAc,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAC9D,CAAC;IACF,mEAAmE;IACnE,SAAS,CAAC,EAAE,qBAAqB,GAAG,KAAK,CAAC;IAC1C;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAaD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,mBAAmB,GAAG,SAAS,GACvC,2BAA2B,GAAG,SAAS,CAgBzC;AA0CD,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAG1D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,mBAAmB,GAC5B,MAAM,CAaR;AAED,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,CA4/BlE;AAgUD;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,QAAQ,EAAE,mBAAmB,EAC7B,WAAW,EAAE,MAAM,EACnB,oBAAoB,EAAE,MAAM,GAC3B,OAAO,CAAC,IAAI,CAAC,CA0bf"}
|
|
@@ -26,6 +26,49 @@ var VIRTUAL_MODULES = {
|
|
|
26
26
|
"@happyvertical/smrt-virt-cli": "smrt:cli",
|
|
27
27
|
"@happyvertical/smrt-virt-web": "smrt:web"
|
|
28
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Project a scanner agent surface into the knowledge-artifact shape (#2591).
|
|
31
|
+
*
|
|
32
|
+
* The two shapes are deliberately separate: the scanner cannot depend on
|
|
33
|
+
* `@happyvertical/smrt-types` (core depends on the scanner, and importing back
|
|
34
|
+
* would close the cycle), so it mirrors the vocabulary structurally and this
|
|
35
|
+
* function is the one place the mirror is reconciled. `filePath` becomes
|
|
36
|
+
* `sourceFile` here because the artifact records a package-relative path, not a
|
|
37
|
+
* scan path.
|
|
38
|
+
*/
|
|
39
|
+
function toKnowledgeAgentSurface(surface) {
|
|
40
|
+
if (!surface) return void 0;
|
|
41
|
+
return {
|
|
42
|
+
intents: surface.intents.map(({ kind: _kind, filePath, ...rest }) => ({
|
|
43
|
+
...rest,
|
|
44
|
+
sourceFile: filePath
|
|
45
|
+
})),
|
|
46
|
+
playbooks: surface.playbooks.map(({ kind: _kind, filePath, ...rest }) => ({
|
|
47
|
+
...rest,
|
|
48
|
+
sourceFile: filePath
|
|
49
|
+
})),
|
|
50
|
+
diagnostics: surface.diagnostics.map(({ filePath, ...rest }) => ({
|
|
51
|
+
...rest,
|
|
52
|
+
sourceFile: filePath
|
|
53
|
+
}))
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Print every declaration the matcher recognized but could not emit.
|
|
58
|
+
*
|
|
59
|
+
* A warning rather than a build failure: a computed tool set is a legitimate
|
|
60
|
+
* choice, and `useWebMcpTool` is its supported path. What is NOT acceptable is
|
|
61
|
+
* the declaration disappearing without a word, so the surface records it and
|
|
62
|
+
* the build says so.
|
|
63
|
+
*/
|
|
64
|
+
function reportAgentSurfaceDiagnostics(surface) {
|
|
65
|
+
if (!surface || surface.diagnostics.length === 0) return;
|
|
66
|
+
console.warn(`[smrt] ⚠️ ${surface.diagnostics.length} declaration(s) are not statically emittable and were excluded from the agent surface:`);
|
|
67
|
+
for (const diagnostic of surface.diagnostics) {
|
|
68
|
+
const where = diagnostic.line ? `${diagnostic.sourceFile}:${diagnostic.line}` : diagnostic.sourceFile;
|
|
69
|
+
console.warn(` ${where} — ${diagnostic.message}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
29
72
|
async function importScanner() {
|
|
30
73
|
return importWorkspaceModule({
|
|
31
74
|
packageName: "@happyvertical/smrt-scanner",
|
|
@@ -102,6 +145,12 @@ function smrtPlugin(options = {}) {
|
|
|
102
145
|
}
|
|
103
146
|
let server;
|
|
104
147
|
let manifest = null;
|
|
148
|
+
/**
|
|
149
|
+
* The declared agent surface from the most recent OXC scan (#2591). Held
|
|
150
|
+
* beside `manifest` rather than on it, because `manifest.json` is the runtime
|
|
151
|
+
* manifest and stays runtime-focused; this belongs to the knowledge artifact.
|
|
152
|
+
*/
|
|
153
|
+
let agentSurface;
|
|
105
154
|
let pluginMode = "server";
|
|
106
155
|
let projectRoot = process.cwd();
|
|
107
156
|
let config = null;
|
|
@@ -161,7 +210,8 @@ function smrtPlugin(options = {}) {
|
|
|
161
210
|
manifest: m,
|
|
162
211
|
rootDir,
|
|
163
212
|
manifestPath,
|
|
164
|
-
config: resolvedKnowledge
|
|
213
|
+
config: resolvedKnowledge,
|
|
214
|
+
agentSurface
|
|
165
215
|
});
|
|
166
216
|
const emitted = deterministic ? {
|
|
167
217
|
...artifact,
|
|
@@ -522,6 +572,8 @@ function smrtPlugin(options = {}) {
|
|
|
522
572
|
exclude: safeExclude,
|
|
523
573
|
followSymbolicLinks
|
|
524
574
|
}).scanAndResolve();
|
|
575
|
+
agentSurface = toKnowledgeAgentSurface(results.agentSurface);
|
|
576
|
+
reportAgentSurfaceDiagnostics(agentSurface);
|
|
525
577
|
if (results.errors.length > 0) {
|
|
526
578
|
console.error(`\n[smrt] ❌ Build failed: ${results.errors.length} error(s) during scanning:\n`);
|
|
527
579
|
for (const error of results.errors) console.error(` ${error.filePath}:${error.line || "?"}: ${error.message}\n`);
|
|
@@ -1379,6 +1431,6 @@ export default setupCLI;
|
|
|
1379
1431
|
}
|
|
1380
1432
|
}
|
|
1381
1433
|
//#endregion
|
|
1382
|
-
export { findCliApiCoherenceViolations, generateInlineRegisterModule, generateSvelteKitRoutes, generateTypeDeclarationFile, isRegisterShimModuleId, loadVerifiedSmrtGenerationSnapshot, methodNameToKebab, resolveApiActionRouteConfig, resolveApiActionSet, serializeSmrtGenerationSnapshot, sha256SmrtGenerationSnapshot, smrtPlugin, validateCliIncludeAgainstApi };
|
|
1434
|
+
export { buildWebMcpToolDefinitions, findCliApiCoherenceViolations, generateInlineRegisterModule, generateSvelteKitRoutes, generateTypeDeclarationFile, isRegisterShimModuleId, loadVerifiedSmrtGenerationSnapshot, methodNameToKebab, resolveApiActionRouteConfig, resolveApiActionSet, serializeSmrtGenerationSnapshot, sha256SmrtGenerationSnapshot, smrtPlugin, toKnowledgeAgentSurface, validateCliIncludeAgainstApi };
|
|
1383
1435
|
|
|
1384
1436
|
//# sourceMappingURL=index.js.map
|