@inupedia/spotlight-client 0.2.13 → 0.3.0
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/dist/capabilities/channel.d.ts +28 -0
- package/dist/capabilities/channel.d.ts.map +1 -0
- package/dist/capabilities/channel.js +129 -0
- package/dist/capabilities/errors.d.ts +9 -0
- package/dist/capabilities/errors.d.ts.map +1 -0
- package/dist/capabilities/errors.js +19 -0
- package/dist/capabilities/handshake.d.ts +36 -0
- package/dist/capabilities/handshake.d.ts.map +1 -0
- package/dist/capabilities/handshake.js +78 -0
- package/dist/capabilities/hostActionExecutor.d.ts +19 -0
- package/dist/capabilities/hostActionExecutor.d.ts.map +1 -0
- package/dist/capabilities/hostActionExecutor.js +60 -0
- package/dist/capabilities/jsonSchema.d.ts +8 -0
- package/dist/capabilities/jsonSchema.d.ts.map +1 -0
- package/dist/capabilities/jsonSchema.js +43 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/node/capabilities/capabilityArtifact.d.ts +2 -0
- package/dist/node/capabilities/capabilityArtifact.d.ts.map +1 -1
- package/dist/node/capabilities/capabilityArtifact.js +6 -0
- package/dist/node/capabilities/capabilityFileMap.d.ts +2 -0
- package/dist/node/capabilities/capabilityFileMap.d.ts.map +1 -1
- package/dist/node/capabilities/capabilityFileMap.js +10 -2
- package/dist/node/capabilities/skillDirectoryLoader.d.ts +24 -0
- package/dist/node/capabilities/skillDirectoryLoader.d.ts.map +1 -0
- package/dist/node/capabilities/skillDirectoryLoader.js +308 -0
- package/dist/node/capabilities/skillFileValidator.d.ts +8 -0
- package/dist/node/capabilities/skillFileValidator.d.ts.map +1 -1
- package/dist/node/capabilities/skillFileValidator.js +46 -26
- package/dist/node/capabilities/skillManifest.d.ts +16 -0
- package/dist/node/capabilities/skillManifest.d.ts.map +1 -0
- package/dist/node/capabilities/skillManifest.js +22 -0
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +2 -0
- package/dist/node/publishCapabilitiesCli.d.ts +3 -0
- package/dist/node/publishCapabilitiesCli.d.ts.map +1 -0
- package/dist/node/publishCapabilitiesCli.js +36 -0
- package/dist/tools/frontendTool.d.ts +39 -0
- package/dist/tools/frontendTool.d.ts.map +1 -0
- package/dist/tools/frontendTool.js +51 -0
- package/dist/vite/capabilityBuild.d.ts +9 -0
- package/dist/vite/capabilityBuild.d.ts.map +1 -0
- package/dist/vite/capabilityBuild.js +164 -0
- package/dist/vite/capabilityBuildTypes.d.ts +31 -0
- package/dist/vite/capabilityBuildTypes.d.ts.map +1 -0
- package/dist/vite/capabilityBuildTypes.js +1 -0
- package/dist/vite/capabilityDevMiddleware.d.ts +5 -0
- package/dist/vite/capabilityDevMiddleware.d.ts.map +1 -0
- package/dist/vite/capabilityDevMiddleware.js +40 -0
- package/dist/vite/capabilityVirtualModule.d.ts +11 -0
- package/dist/vite/capabilityVirtualModule.d.ts.map +1 -0
- package/dist/vite/capabilityVirtualModule.js +43 -0
- package/dist/vite/capabilityVirtualModuleTypes.d.ts +12 -0
- package/dist/vite/capabilityVirtualModuleTypes.d.ts.map +1 -0
- package/dist/vite/capabilityVirtualModuleTypes.js +1 -0
- package/dist/vite/index.d.ts +4 -0
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +3 -0
- package/dist/vite/spotlightCapabilities.d.ts +4 -0
- package/dist/vite/spotlightCapabilities.d.ts.map +1 -0
- package/dist/vite/spotlightCapabilities.js +170 -0
- package/package.json +7 -4
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export function defineFrontendTool(definition) {
|
|
2
|
+
if (typeof definition.execute !== "function") {
|
|
3
|
+
throw new TypeError("Frontend Tool execute must be a function.");
|
|
4
|
+
}
|
|
5
|
+
return Object.freeze({ ...definition });
|
|
6
|
+
}
|
|
7
|
+
export function defineSpotlightProject(input) {
|
|
8
|
+
const projectId = input.projectId.trim();
|
|
9
|
+
if (!projectId)
|
|
10
|
+
throw new TypeError("Spotlight projectId must be non-empty.");
|
|
11
|
+
const identities = new Set();
|
|
12
|
+
for (const tool of input.tools) {
|
|
13
|
+
const identity = `${tool.name}@${tool.version}`;
|
|
14
|
+
if (identities.has(identity))
|
|
15
|
+
throw new TypeError(`Duplicate Frontend Tool: ${identity}`);
|
|
16
|
+
identities.add(identity);
|
|
17
|
+
}
|
|
18
|
+
return Object.freeze({
|
|
19
|
+
projectId,
|
|
20
|
+
...(input.skillRoots
|
|
21
|
+
? { skillRoots: Object.freeze([...input.skillRoots]) }
|
|
22
|
+
: {}),
|
|
23
|
+
tools: Object.freeze([...input.tools]),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
export function projectToolDescriptors(project) {
|
|
27
|
+
return project.tools.map(({ execute: _execute, ...descriptor }) => JSON.parse(JSON.stringify(descriptor)));
|
|
28
|
+
}
|
|
29
|
+
export function createFrontendToolRegistry(project) {
|
|
30
|
+
const definitions = new Map(project.tools.map((tool) => [`${tool.name}@${tool.version}`, tool]));
|
|
31
|
+
const live = new Set(definitions.keys());
|
|
32
|
+
const key = (name, version) => `${name}@${version}`;
|
|
33
|
+
return Object.freeze({
|
|
34
|
+
projectId: project.projectId,
|
|
35
|
+
get: (name, version) => definitions.get(key(name, version)),
|
|
36
|
+
setLive(name, version, value) {
|
|
37
|
+
const identity = key(name, version);
|
|
38
|
+
if (!definitions.has(identity))
|
|
39
|
+
throw new TypeError(`Unknown Frontend Tool: ${identity}`);
|
|
40
|
+
if (value)
|
|
41
|
+
live.add(identity);
|
|
42
|
+
else
|
|
43
|
+
live.delete(identity);
|
|
44
|
+
},
|
|
45
|
+
liveTools: () => [...live].sort().map((identity) => {
|
|
46
|
+
const tool = definitions.get(identity);
|
|
47
|
+
return { name: tool.name, version: tool.version };
|
|
48
|
+
}),
|
|
49
|
+
descriptors: () => projectToolDescriptors(project),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CapabilityPluginBuildResultV1, SpotlightCapabilitiesOptionsV1, SpotlightCapabilityProjectBuildV1 } from "./capabilityBuildTypes.js";
|
|
2
|
+
export type { CapabilityBuildInfoV1, CapabilityPluginBuildResultV1, SpotlightCapabilitiesOptionsV1, SpotlightCapabilityProjectBuildV1, } from "./capabilityBuildTypes.js";
|
|
3
|
+
export declare function buildViteCapabilitiesV1(input: {
|
|
4
|
+
root: string;
|
|
5
|
+
command: "serve" | "build";
|
|
6
|
+
project: SpotlightCapabilityProjectBuildV1;
|
|
7
|
+
options?: SpotlightCapabilitiesOptionsV1;
|
|
8
|
+
}): Promise<CapabilityPluginBuildResultV1>;
|
|
9
|
+
//# sourceMappingURL=capabilityBuild.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilityBuild.d.ts","sourceRoot":"","sources":["../../src/vite/capabilityBuild.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAEV,6BAA6B,EAC7B,8BAA8B,EAC9B,iCAAiC,EAClC,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,iCAAiC,GAClC,MAAM,2BAA2B,CAAC;AAsHnC,wBAAsB,uBAAuB,CAAC,KAAK,EAAE;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IAC3B,OAAO,EAAE,iCAAiC,CAAC;IAC3C,OAAO,CAAC,EAAE,8BAA8B,CAAC;CAC1C,GAAG,OAAO,CAAC,6BAA6B,CAAC,CA8FzC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { resolve, sep } from "node:path";
|
|
2
|
+
import { isProxy } from "node:util/types";
|
|
3
|
+
import { buildCapabilityArtifactV1, buildToolManifestV1, CapabilityArtifactError, loadCanonicalSkillsV1, scanProjectSkills, } from "../node/index.js";
|
|
4
|
+
import { validateSkillContent } from "../node/capabilities/skillFileValidator.js";
|
|
5
|
+
const PROJECT_FIELDS = new Set(["projectId", "tools"]);
|
|
6
|
+
function invalidInput(message) {
|
|
7
|
+
throw new CapabilityArtifactError("ARTIFACT_INPUT_INVALID", message);
|
|
8
|
+
}
|
|
9
|
+
function validateProject(value) {
|
|
10
|
+
if (value === null ||
|
|
11
|
+
typeof value !== "object" ||
|
|
12
|
+
Array.isArray(value) ||
|
|
13
|
+
isProxy(value)) {
|
|
14
|
+
invalidInput("Capability project must be a plain object");
|
|
15
|
+
}
|
|
16
|
+
const prototype = Object.getPrototypeOf(value);
|
|
17
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
18
|
+
invalidInput("Capability project must be a plain object");
|
|
19
|
+
}
|
|
20
|
+
const keys = Reflect.ownKeys(value);
|
|
21
|
+
if (keys.length !== PROJECT_FIELDS.size ||
|
|
22
|
+
keys.some((key) => typeof key !== "string" || !PROJECT_FIELDS.has(key))) {
|
|
23
|
+
invalidInput("Capability project own fields must be exactly projectId and tools");
|
|
24
|
+
}
|
|
25
|
+
const readDataField = (field) => {
|
|
26
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, field);
|
|
27
|
+
if (!descriptor?.enumerable || !("value" in descriptor)) {
|
|
28
|
+
invalidInput(`Capability project field ${field} must be an enumerable data property`);
|
|
29
|
+
}
|
|
30
|
+
return descriptor.value;
|
|
31
|
+
};
|
|
32
|
+
const projectId = readDataField("projectId");
|
|
33
|
+
const tools = readDataField("tools");
|
|
34
|
+
if (typeof projectId !== "string" || projectId.trim().length === 0) {
|
|
35
|
+
invalidInput("Capability projectId must be a non-empty string");
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
projectId,
|
|
39
|
+
tools: tools,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function safeToolDescriptors(tools) {
|
|
43
|
+
return tools.map((tool, index) => {
|
|
44
|
+
if (isProxy(tool)) {
|
|
45
|
+
throw new CapabilityArtifactError("ARTIFACT_JSON_UNSUPPORTED_VALUE", `Tool descriptor ${index} must not be a Proxy`);
|
|
46
|
+
}
|
|
47
|
+
if (tool === null || typeof tool !== "object" || Array.isArray(tool)) {
|
|
48
|
+
invalidInput(`Tool descriptor ${index} must be a plain object`);
|
|
49
|
+
}
|
|
50
|
+
const result = {};
|
|
51
|
+
for (const key of Reflect.ownKeys(tool)) {
|
|
52
|
+
if (typeof key !== "string")
|
|
53
|
+
invalidInput(`Tool descriptor ${index} contains a symbol field`);
|
|
54
|
+
const descriptor = Object.getOwnPropertyDescriptor(tool, key);
|
|
55
|
+
if (!descriptor?.enumerable || !("value" in descriptor)) {
|
|
56
|
+
throw new CapabilityArtifactError("ARTIFACT_JSON_UNSUPPORTED_VALUE", `Tool descriptor ${index}.${key} must be an enumerable data property`);
|
|
57
|
+
}
|
|
58
|
+
if (key !== "execute")
|
|
59
|
+
result[key] = descriptor.value;
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function throwDiagnostic(diagnostic) {
|
|
65
|
+
const message = "message" in diagnostic
|
|
66
|
+
? diagnostic.message
|
|
67
|
+
: `Skill scan failed with ${diagnostic.code}`;
|
|
68
|
+
throw Object.assign(new Error(message), diagnostic);
|
|
69
|
+
}
|
|
70
|
+
function freezeDiagnostic(diagnostic) {
|
|
71
|
+
if ("candidates" in diagnostic) {
|
|
72
|
+
const candidates = [...diagnostic.candidates];
|
|
73
|
+
Object.freeze(candidates);
|
|
74
|
+
return Object.freeze({
|
|
75
|
+
code: diagnostic.code,
|
|
76
|
+
severity: diagnostic.severity,
|
|
77
|
+
name: diagnostic.name,
|
|
78
|
+
...(diagnostic.selected === undefined
|
|
79
|
+
? {}
|
|
80
|
+
: { selected: diagnostic.selected }),
|
|
81
|
+
candidates,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return Object.freeze({
|
|
85
|
+
code: diagnostic.code,
|
|
86
|
+
severity: diagnostic.severity,
|
|
87
|
+
message: diagnostic.message,
|
|
88
|
+
skillFile: diagnostic.skillFile,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
export async function buildViteCapabilitiesV1(input) {
|
|
92
|
+
const project = validateProject(input.project);
|
|
93
|
+
const toolManifest = buildToolManifestV1(safeToolDescriptors(project.tools));
|
|
94
|
+
const frontendBuildId = input.options?.frontendBuildId;
|
|
95
|
+
if (input.command === "build" &&
|
|
96
|
+
(frontendBuildId === undefined || frontendBuildId.trim().length === 0)) {
|
|
97
|
+
invalidInput("Production capability builds require frontendBuildId");
|
|
98
|
+
}
|
|
99
|
+
const mode = input.command === "build" ? "strict" : "compat";
|
|
100
|
+
const scan = await scanProjectSkills({
|
|
101
|
+
projectRoot: input.root,
|
|
102
|
+
mode,
|
|
103
|
+
skillRoots: input.options?.skillRoots,
|
|
104
|
+
});
|
|
105
|
+
const scanErrorDiagnostic = scan.diagnostics.find((diagnostic) => diagnostic.severity === "error");
|
|
106
|
+
if (scanErrorDiagnostic)
|
|
107
|
+
throwDiagnostic(scanErrorDiagnostic);
|
|
108
|
+
const loaded = await loadCanonicalSkillsV1({
|
|
109
|
+
projectRoot: input.root,
|
|
110
|
+
skills: scan.skills,
|
|
111
|
+
});
|
|
112
|
+
const loadedByName = new Map(loaded.skills.map((skill) => [skill.name, skill]));
|
|
113
|
+
const validation = await Promise.all(scan.skills.map(async (skill) => {
|
|
114
|
+
const loadedSkill = loadedByName.get(skill.name);
|
|
115
|
+
if (!loadedSkill) {
|
|
116
|
+
invalidInput(`Loaded Skill snapshot is missing ${skill.name}`);
|
|
117
|
+
}
|
|
118
|
+
const skillFile = loadedSkill.files.find((file) => file.relativePath === "SKILL.md");
|
|
119
|
+
if (!skillFile) {
|
|
120
|
+
invalidInput(`Loaded Skill ${skill.name} is missing SKILL.md`);
|
|
121
|
+
}
|
|
122
|
+
const files = new Map(loadedSkill.files.map((file) => [file.relativePath, file.bytes]));
|
|
123
|
+
return validateSkillContent({
|
|
124
|
+
skill,
|
|
125
|
+
markdown: Buffer.from(skillFile.bytes).toString("utf8"),
|
|
126
|
+
mode,
|
|
127
|
+
skillRoot: resolve(input.root, skill.directory),
|
|
128
|
+
async readReference(relativePath) {
|
|
129
|
+
const snapshotPath = relativePath.split(sep).join("/");
|
|
130
|
+
return files.get(snapshotPath);
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
}));
|
|
134
|
+
const diagnostics = [
|
|
135
|
+
...scan.diagnostics,
|
|
136
|
+
...validation.flatMap((result) => result.diagnostics),
|
|
137
|
+
].map(freezeDiagnostic);
|
|
138
|
+
const errorDiagnostic = diagnostics.find((diagnostic) => diagnostic.severity === "error");
|
|
139
|
+
if (errorDiagnostic)
|
|
140
|
+
throwDiagnostic(errorDiagnostic);
|
|
141
|
+
const artifact = buildCapabilityArtifactV1({
|
|
142
|
+
skills: loaded.skills,
|
|
143
|
+
tools: toolManifest.manifest.tools,
|
|
144
|
+
});
|
|
145
|
+
const buildInfo = Object.freeze({
|
|
146
|
+
schemaVersion: "spotlight.capability-build-info/1",
|
|
147
|
+
projectId: project.projectId,
|
|
148
|
+
frontendBuildId: input.command === "build"
|
|
149
|
+
? frontendBuildId
|
|
150
|
+
: `dev:${artifact.artifactDigest}`,
|
|
151
|
+
artifactVersion: artifact.artifactVersion,
|
|
152
|
+
artifactDigest: artifact.artifactDigest,
|
|
153
|
+
manifestDigest: artifact.manifestDigest,
|
|
154
|
+
skillManifestDigest: artifact.skillManifestDigest,
|
|
155
|
+
toolManifestDigest: artifact.toolManifestDigest,
|
|
156
|
+
byteLength: artifact.byteLength,
|
|
157
|
+
});
|
|
158
|
+
return {
|
|
159
|
+
buildInfo,
|
|
160
|
+
archive: artifact.archive,
|
|
161
|
+
watchedFiles: Object.freeze([...loaded.watchedFiles]),
|
|
162
|
+
diagnostics: Object.freeze([...diagnostics]),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { FrontendToolDescriptorV1 } from "@inupedia/spotlight-protocol";
|
|
2
|
+
import type { FrontendToolDefinitionV1 } from "../tools/frontendTool.js";
|
|
3
|
+
import type { SkillRootInput, SkillScanDiagnostic } from "../node/capabilities/skillScanner.js";
|
|
4
|
+
import type { AgentSkillDiagnostic } from "../node/capabilities/skillValidator.js";
|
|
5
|
+
export interface SpotlightCapabilityProjectBuildV1 {
|
|
6
|
+
projectId: string;
|
|
7
|
+
tools: readonly (FrontendToolDescriptorV1 | FrontendToolDefinitionV1)[];
|
|
8
|
+
}
|
|
9
|
+
export interface SpotlightCapabilitiesOptionsV1 {
|
|
10
|
+
skillRoots?: readonly SkillRootInput[];
|
|
11
|
+
frontendBuildId?: string;
|
|
12
|
+
devRuntimeUpload?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface CapabilityBuildInfoV1 {
|
|
15
|
+
schemaVersion: "spotlight.capability-build-info/1";
|
|
16
|
+
projectId: string;
|
|
17
|
+
frontendBuildId: string;
|
|
18
|
+
artifactVersion: "spotlight.capability-artifact/1";
|
|
19
|
+
artifactDigest: string;
|
|
20
|
+
manifestDigest: string;
|
|
21
|
+
skillManifestDigest: string;
|
|
22
|
+
toolManifestDigest: string;
|
|
23
|
+
byteLength: number;
|
|
24
|
+
}
|
|
25
|
+
export interface CapabilityPluginBuildResultV1 {
|
|
26
|
+
buildInfo: Readonly<CapabilityBuildInfoV1>;
|
|
27
|
+
archive: Uint8Array;
|
|
28
|
+
watchedFiles: readonly string[];
|
|
29
|
+
diagnostics: readonly (SkillScanDiagnostic | AgentSkillDiagnostic)[];
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=capabilityBuildTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilityBuildTypes.d.ts","sourceRoot":"","sources":["../../src/vite/capabilityBuildTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAEnF,MAAM,WAAW,iCAAiC;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,SAAS,CAAC,wBAAwB,GAAG,wBAAwB,CAAC,EAAE,CAAC;CACzE;AAED,MAAM,WAAW,8BAA8B;IAC7C,UAAU,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,mCAAmC,CAAC;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,iCAAiC,CAAC;IACnD,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IAC3C,OAAO,EAAE,UAAU,CAAC;IACpB,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAAG,oBAAoB,CAAC,EAAE,CAAC;CACtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import type { CapabilityPluginBuildResultV1 } from "./capabilityBuildTypes.js";
|
|
3
|
+
export type CapabilityDevMiddlewareV1 = (request: IncomingMessage, response: ServerResponse, next: () => void) => void;
|
|
4
|
+
export declare function createCapabilityDevMiddlewareV1(currentResult: () => Readonly<CapabilityPluginBuildResultV1>): CapabilityDevMiddlewareV1;
|
|
5
|
+
//# sourceMappingURL=capabilityDevMiddleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilityDevMiddleware.d.ts","sourceRoot":"","sources":["../../src/vite/capabilityDevMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAK/E,MAAM,MAAM,yBAAyB,GAAG,CACtC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,IAAI,KACb,IAAI,CAAC;AAEV,wBAAgB,+BAA+B,CAC7C,aAAa,EAAE,MAAM,QAAQ,CAAC,6BAA6B,CAAC,GAC3D,yBAAyB,CAgD3B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const ROUTE_PREFIX = "/@spotlight/capability-artifacts/";
|
|
2
|
+
const DIGEST_PATTERN = /^sha256:[a-f0-9]{64}$/;
|
|
3
|
+
export function createCapabilityDevMiddlewareV1(currentResult) {
|
|
4
|
+
return (request, response, next) => {
|
|
5
|
+
const url = request.url ?? "";
|
|
6
|
+
if (!url.startsWith(ROUTE_PREFIX)) {
|
|
7
|
+
next();
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const requestedDigest = url.slice(ROUTE_PREFIX.length);
|
|
11
|
+
if (!DIGEST_PATTERN.test(requestedDigest)) {
|
|
12
|
+
response.statusCode = 404;
|
|
13
|
+
response.end();
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const method = request.method ?? "GET";
|
|
17
|
+
if (method !== "GET" && method !== "HEAD") {
|
|
18
|
+
response.statusCode = 405;
|
|
19
|
+
response.setHeader("Allow", "GET, HEAD");
|
|
20
|
+
response.end();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const result = currentResult();
|
|
24
|
+
if (requestedDigest !== result.buildInfo.artifactDigest) {
|
|
25
|
+
response.statusCode = 404;
|
|
26
|
+
response.end();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
response.statusCode = 200;
|
|
30
|
+
response.setHeader("Content-Type", "application/gzip");
|
|
31
|
+
response.setHeader("Content-Length", String(result.archive.byteLength));
|
|
32
|
+
response.setHeader("Cache-Control", "no-store");
|
|
33
|
+
response.setHeader("X-Content-Type-Options", "nosniff");
|
|
34
|
+
if (method === "HEAD") {
|
|
35
|
+
response.end();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
response.end(Buffer.from(result.archive.buffer, result.archive.byteOffset, result.archive.byteLength));
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CapabilityBuildInfoV1 } from "./capabilityBuildTypes.js";
|
|
2
|
+
export declare const SPOTLIGHT_CAPABILITIES_MODULE_ID: "virtual:spotlight/capabilities";
|
|
3
|
+
export declare const RESOLVED_SPOTLIGHT_CAPABILITIES_MODULE_ID: "\0virtual:spotlight/capabilities";
|
|
4
|
+
export interface CapabilityVirtualModuleV1 {
|
|
5
|
+
canonicalBuildInfoJson: string;
|
|
6
|
+
source: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function buildCapabilityVirtualModuleV1(buildInfo: Readonly<CapabilityBuildInfoV1>, options?: Readonly<{
|
|
9
|
+
runtimeUpload?: boolean;
|
|
10
|
+
}>): Readonly<CapabilityVirtualModuleV1>;
|
|
11
|
+
//# sourceMappingURL=capabilityVirtualModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilityVirtualModule.d.ts","sourceRoot":"","sources":["../../src/vite/capabilityVirtualModule.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,gCAAgC,EAC3C,gCAAyC,CAAC;AAC5C,eAAO,MAAM,yCAAyC,EACpD,kCAA2C,CAAC;AAE9C,MAAM,WAAW,yBAAyB;IACxC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;CAChB;AAyCD,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EAC1C,OAAO,GAAE,QAAQ,CAAC;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,CAAM,GAClD,QAAQ,CAAC,yBAAyB,CAAC,CAQrC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { canonicalizeJson } from "../node/capabilities/canonicalJson.js";
|
|
2
|
+
export const SPOTLIGHT_CAPABILITIES_MODULE_ID = "virtual:spotlight/capabilities";
|
|
3
|
+
export const RESOLVED_SPOTLIGHT_CAPABILITIES_MODULE_ID = "\0virtual:spotlight/capabilities";
|
|
4
|
+
function disabledProviderSource() {
|
|
5
|
+
return `export async function openUploadStream() {
|
|
6
|
+
const error = new Error("Runtime capability Artifact upload is disabled.");
|
|
7
|
+
Object.defineProperty(error, "code", {
|
|
8
|
+
value: "ARTIFACT_RUNTIME_UPLOAD_DISABLED",
|
|
9
|
+
enumerable: true,
|
|
10
|
+
});
|
|
11
|
+
throw error;
|
|
12
|
+
}`;
|
|
13
|
+
}
|
|
14
|
+
function developmentProviderSource(buildInfo) {
|
|
15
|
+
const digest = JSON.stringify(buildInfo.artifactDigest);
|
|
16
|
+
const path = JSON.stringify(`/@spotlight/capability-artifacts/${buildInfo.artifactDigest}`);
|
|
17
|
+
return `export async function openUploadStream() {
|
|
18
|
+
const response = await fetch(${path}, {
|
|
19
|
+
method: "GET",
|
|
20
|
+
cache: "no-store",
|
|
21
|
+
credentials: "same-origin",
|
|
22
|
+
});
|
|
23
|
+
if (!response.ok) {
|
|
24
|
+
throw new Error("Unable to open capability Artifact stream.");
|
|
25
|
+
}
|
|
26
|
+
if (response.body == null) {
|
|
27
|
+
throw new Error("Capability Artifact response has no stream body.");
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
digest: ${digest},
|
|
31
|
+
byteLength: capabilityBuildInfo.byteLength,
|
|
32
|
+
contentType: "application/gzip",
|
|
33
|
+
stream: response.body,
|
|
34
|
+
};
|
|
35
|
+
}`;
|
|
36
|
+
}
|
|
37
|
+
export function buildCapabilityVirtualModuleV1(buildInfo, options = {}) {
|
|
38
|
+
const canonicalBuildInfoJson = new TextDecoder().decode(canonicalizeJson(buildInfo));
|
|
39
|
+
return Object.freeze({
|
|
40
|
+
canonicalBuildInfoJson,
|
|
41
|
+
source: `export const capabilityBuildInfo = Object.freeze(${canonicalBuildInfoJson});\n\n${options.runtimeUpload === true ? developmentProviderSource(buildInfo) : disabledProviderSource()}\n`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare module "virtual:spotlight/capabilities" {
|
|
2
|
+
import type { CapabilityBuildInfoV1 } from "@inupedia/spotlight-client/vite";
|
|
3
|
+
interface ArtifactUploadStreamV1 {
|
|
4
|
+
digest: string;
|
|
5
|
+
byteLength: number;
|
|
6
|
+
contentType: "application/gzip";
|
|
7
|
+
stream: ReadableStream<Uint8Array>;
|
|
8
|
+
}
|
|
9
|
+
const capabilityBuildInfo: Readonly<CapabilityBuildInfoV1>;
|
|
10
|
+
function openUploadStream(): Promise<ArtifactUploadStreamV1>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=capabilityVirtualModuleTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilityVirtualModuleTypes.d.ts","sourceRoot":"","sources":["../../src/vite/capabilityVirtualModuleTypes.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,gCAAgC,CAAC;IAC9C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;IAE7E,UAAiB,sBAAsB;QACrC,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,kBAAkB,CAAC;QAChC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;KACpC;IAEM,MAAM,mBAAmB,EAAE,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IAElE,SAAgB,gBAAgB,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACrE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/dist/vite/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { SpotlightAgentIocOptions } from "./spotlightAgentIoc.js";
|
|
2
|
+
import "./capabilityVirtualModuleTypes.js";
|
|
2
3
|
export type { SpotlightAgentIocOptions };
|
|
4
|
+
export { spotlightCapabilities } from "./spotlightCapabilities.js";
|
|
5
|
+
export type { CapabilityBuildInfoV1, CapabilityPluginBuildResultV1, SpotlightCapabilitiesOptionsV1, SpotlightCapabilityProjectBuildV1, } from "./capabilityBuildTypes.js";
|
|
6
|
+
export { RESOLVED_SPOTLIGHT_CAPABILITIES_MODULE_ID, SPOTLIGHT_CAPABILITIES_MODULE_ID, } from "./capabilityVirtualModule.js";
|
|
3
7
|
export { transformSpotlightAgentIoc, default, } from "./spotlightAgentIoc.js";
|
|
4
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/vite/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,YAAY,EAAE,wBAAwB,EAAE,CAAC;AAEzC,OAAO,EACL,0BAA0B,EAC1B,OAAO,GACR,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,OAAO,mCAAmC,CAAC;AAE3C,YAAY,EAAE,wBAAwB,EAAE,CAAC;AAEzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EACV,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,iCAAiC,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,yCAAyC,EACzC,gCAAgC,GACjC,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,0BAA0B,EAC1B,OAAO,GACR,MAAM,wBAAwB,CAAC"}
|
package/dist/vite/index.js
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
+
import "./capabilityVirtualModuleTypes.js";
|
|
2
|
+
export { spotlightCapabilities } from "./spotlightCapabilities.js";
|
|
3
|
+
export { RESOLVED_SPOTLIGHT_CAPABILITIES_MODULE_ID, SPOTLIGHT_CAPABILITIES_MODULE_ID, } from "./capabilityVirtualModule.js";
|
|
1
4
|
export { transformSpotlightAgentIoc, default, } from "./spotlightAgentIoc.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Plugin } from "vite";
|
|
2
|
+
import { type SpotlightCapabilitiesOptionsV1, type SpotlightCapabilityProjectBuildV1 } from "./capabilityBuild.js";
|
|
3
|
+
export declare function spotlightCapabilities(project: SpotlightCapabilityProjectBuildV1, options?: SpotlightCapabilitiesOptionsV1): Plugin;
|
|
4
|
+
//# sourceMappingURL=spotlightCapabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlightCapabilities.d.ts","sourceRoot":"","sources":["../../src/vite/spotlightCapabilities.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAiC,MAAM,MAAM,CAAC;AAKlE,OAAO,EAGL,KAAK,8BAA8B,EACnC,KAAK,iCAAiC,EACvC,MAAM,sBAAsB,CAAC;AAuB9B,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,iCAAiC,EAC1C,OAAO,CAAC,EAAE,8BAA8B,GACvC,MAAM,CAyKR"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
2
|
+
import { DEFAULT_SKILL_ROOTS } from "../node/index.js";
|
|
3
|
+
import { createCapabilityDevMiddlewareV1 } from "./capabilityDevMiddleware.js";
|
|
4
|
+
import { buildViteCapabilitiesV1, } from "./capabilityBuild.js";
|
|
5
|
+
import { buildCapabilityVirtualModuleV1, RESOLVED_SPOTLIGHT_CAPABILITIES_MODULE_ID, SPOTLIGHT_CAPABILITIES_MODULE_ID, } from "./capabilityVirtualModule.js";
|
|
6
|
+
function isAtOrBelow(candidate, directory) {
|
|
7
|
+
const relativePath = relative(directory, candidate);
|
|
8
|
+
return (relativePath === "" ||
|
|
9
|
+
(!relativePath.startsWith(`..${sep}`) &&
|
|
10
|
+
relativePath !== ".." &&
|
|
11
|
+
!isAbsolute(relativePath)));
|
|
12
|
+
}
|
|
13
|
+
export function spotlightCapabilities(project, options) {
|
|
14
|
+
let root;
|
|
15
|
+
let command;
|
|
16
|
+
let state;
|
|
17
|
+
let server;
|
|
18
|
+
let rebuildChain = Promise.resolve();
|
|
19
|
+
let relevantRoots = [];
|
|
20
|
+
let removeServerListeners;
|
|
21
|
+
let finishInitialization;
|
|
22
|
+
const initialization = new Promise((resolveInitialization) => {
|
|
23
|
+
finishInitialization = resolveInitialization;
|
|
24
|
+
});
|
|
25
|
+
const currentState = () => {
|
|
26
|
+
if (state === undefined) {
|
|
27
|
+
throw new Error("Spotlight capabilities were not built.");
|
|
28
|
+
}
|
|
29
|
+
return state;
|
|
30
|
+
};
|
|
31
|
+
const createState = (result) => Object.freeze({
|
|
32
|
+
result: Object.freeze(result),
|
|
33
|
+
virtualModule: buildCapabilityVirtualModuleV1(result.buildInfo, {
|
|
34
|
+
runtimeUpload: command === "serve" && options?.devRuntimeUpload !== false,
|
|
35
|
+
}),
|
|
36
|
+
});
|
|
37
|
+
const isRelevantFile = (file) => {
|
|
38
|
+
const absoluteFile = resolve(file);
|
|
39
|
+
const current = state;
|
|
40
|
+
return (current?.result.watchedFiles.some((watchedFile) => resolve(watchedFile) === absoluteFile) === true ||
|
|
41
|
+
relevantRoots.some((skillRoot) => isAtOrBelow(absoluteFile, skillRoot)));
|
|
42
|
+
};
|
|
43
|
+
const enqueueRebuild = (file) => {
|
|
44
|
+
if (command !== "serve" || root === undefined || !isRelevantFile(file)) {
|
|
45
|
+
return Promise.resolve();
|
|
46
|
+
}
|
|
47
|
+
const projectRoot = root;
|
|
48
|
+
const task = rebuildChain.then(async () => {
|
|
49
|
+
await initialization;
|
|
50
|
+
if (state === undefined)
|
|
51
|
+
return;
|
|
52
|
+
try {
|
|
53
|
+
const result = await buildViteCapabilitiesV1({
|
|
54
|
+
root: projectRoot,
|
|
55
|
+
command: "serve",
|
|
56
|
+
project,
|
|
57
|
+
options,
|
|
58
|
+
});
|
|
59
|
+
const nextState = createState(result);
|
|
60
|
+
server?.watcher.add([...result.watchedFiles]);
|
|
61
|
+
const moduleNode = server?.moduleGraph.getModuleById(RESOLVED_SPOTLIGHT_CAPABILITIES_MODULE_ID);
|
|
62
|
+
const previousState = state;
|
|
63
|
+
state = nextState;
|
|
64
|
+
try {
|
|
65
|
+
if (moduleNode !== undefined) {
|
|
66
|
+
server?.moduleGraph.invalidateModule(moduleNode);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
state = previousState;
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
try {
|
|
76
|
+
server?.config.logger.error("[CAPABILITY_DEV_REBUILD_FAILED] Capability development rebuild failed.");
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// A development logger failure must not poison later rebuilds.
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
rebuildChain = task.catch(() => undefined);
|
|
84
|
+
return task;
|
|
85
|
+
};
|
|
86
|
+
return {
|
|
87
|
+
name: "spotlight-capabilities",
|
|
88
|
+
configResolved(config) {
|
|
89
|
+
root = config.root;
|
|
90
|
+
command = config.command;
|
|
91
|
+
const roots = options?.skillRoots ?? DEFAULT_SKILL_ROOTS;
|
|
92
|
+
relevantRoots = Object.freeze(roots.map((entry) => {
|
|
93
|
+
const path = typeof entry === "string" ? entry : entry.path;
|
|
94
|
+
return resolve(config.root, path);
|
|
95
|
+
}));
|
|
96
|
+
},
|
|
97
|
+
async buildStart() {
|
|
98
|
+
if (root === undefined || command === undefined) {
|
|
99
|
+
throw new Error("Spotlight capabilities require resolved Vite config.");
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
const result = await buildViteCapabilitiesV1({
|
|
103
|
+
root,
|
|
104
|
+
command,
|
|
105
|
+
project,
|
|
106
|
+
options,
|
|
107
|
+
});
|
|
108
|
+
state = createState(result);
|
|
109
|
+
for (const file of result.watchedFiles)
|
|
110
|
+
this.addWatchFile(file);
|
|
111
|
+
}
|
|
112
|
+
finally {
|
|
113
|
+
finishInitialization();
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
configureServer(viteServer) {
|
|
117
|
+
removeServerListeners?.();
|
|
118
|
+
server = viteServer;
|
|
119
|
+
viteServer.watcher.add([...relevantRoots]);
|
|
120
|
+
const add = (file) => enqueueRebuild(file);
|
|
121
|
+
const change = (file) => enqueueRebuild(file);
|
|
122
|
+
const unlink = (file) => enqueueRebuild(file);
|
|
123
|
+
viteServer.watcher.on("add", add);
|
|
124
|
+
viteServer.watcher.on("change", change);
|
|
125
|
+
viteServer.watcher.on("unlink", unlink);
|
|
126
|
+
const cleanup = () => {
|
|
127
|
+
viteServer.watcher.off("add", add);
|
|
128
|
+
viteServer.watcher.off("change", change);
|
|
129
|
+
viteServer.watcher.off("unlink", unlink);
|
|
130
|
+
viteServer.httpServer?.off("close", cleanup);
|
|
131
|
+
if (removeServerListeners === cleanup) {
|
|
132
|
+
removeServerListeners = undefined;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
removeServerListeners = cleanup;
|
|
136
|
+
viteServer.httpServer?.once("close", cleanup);
|
|
137
|
+
if (options?.devRuntimeUpload === false)
|
|
138
|
+
return;
|
|
139
|
+
viteServer.middlewares.use(createCapabilityDevMiddlewareV1(() => currentState().result));
|
|
140
|
+
},
|
|
141
|
+
resolveId(id) {
|
|
142
|
+
return id === SPOTLIGHT_CAPABILITIES_MODULE_ID
|
|
143
|
+
? RESOLVED_SPOTLIGHT_CAPABILITIES_MODULE_ID
|
|
144
|
+
: null;
|
|
145
|
+
},
|
|
146
|
+
load(id) {
|
|
147
|
+
if (id !== RESOLVED_SPOTLIGHT_CAPABILITIES_MODULE_ID)
|
|
148
|
+
return null;
|
|
149
|
+
return currentState().virtualModule.source;
|
|
150
|
+
},
|
|
151
|
+
closeBundle() {
|
|
152
|
+
removeServerListeners?.();
|
|
153
|
+
},
|
|
154
|
+
generateBundle() {
|
|
155
|
+
if (command !== "build")
|
|
156
|
+
return;
|
|
157
|
+
const current = currentState();
|
|
158
|
+
this.emitFile({
|
|
159
|
+
type: "asset",
|
|
160
|
+
fileName: "capability-build-info.json",
|
|
161
|
+
source: `${current.virtualModule.canonicalBuildInfoJson}\n`,
|
|
162
|
+
});
|
|
163
|
+
this.emitFile({
|
|
164
|
+
type: "asset",
|
|
165
|
+
fileName: `capability-artifacts/${current.result.buildInfo.artifactDigest}.tar.gz`,
|
|
166
|
+
source: current.result.archive,
|
|
167
|
+
});
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inupedia/spotlight-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "HTTP/SSE helpers and host tool bridge for Inupedia Spotlight (monorepo workspace package)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"import": "./dist/index.js"
|
|
12
12
|
},
|
|
13
13
|
"./vite": {
|
|
14
|
-
"types": "./dist/vite/
|
|
15
|
-
"import": "./dist/vite/
|
|
14
|
+
"types": "./dist/vite/index.d.ts",
|
|
15
|
+
"import": "./dist/vite/index.js"
|
|
16
16
|
},
|
|
17
17
|
"./node": {
|
|
18
18
|
"types": "./dist/node/index.d.ts",
|
|
@@ -28,6 +28,9 @@
|
|
|
28
28
|
},
|
|
29
29
|
"main": "./dist/index.js",
|
|
30
30
|
"types": "./dist/index.d.ts",
|
|
31
|
+
"bin": {
|
|
32
|
+
"spotlight-capabilities": "./dist/node/publishCapabilitiesCli.js"
|
|
33
|
+
},
|
|
31
34
|
"publishConfig": {
|
|
32
35
|
"access": "public"
|
|
33
36
|
},
|
|
@@ -43,7 +46,7 @@
|
|
|
43
46
|
"fflate": "0.8.3",
|
|
44
47
|
"magic-string": "^0.30.21",
|
|
45
48
|
"yaml": "^2.8.4",
|
|
46
|
-
"@inupedia/spotlight-protocol": "0.
|
|
49
|
+
"@inupedia/spotlight-protocol": "0.3.0"
|
|
47
50
|
},
|
|
48
51
|
"peerDependencies": {
|
|
49
52
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|