@unoverse-platform/studio 0.1.94 → 0.1.96
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/local/scaffold.mjs
CHANGED
|
@@ -185,11 +185,43 @@ export function topUpSamples(home, project) {
|
|
|
185
185
|
* Skills, prompt blocks and nodes are per-developer and not per-project, so they are made
|
|
186
186
|
* once here and never by `createProject`.
|
|
187
187
|
*/
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* EDITOR HELP FOR NODES, WITHOUT A LINE IN EVERY FILE (2026-09-05). The YAML language
|
|
191
|
+
* server maps files to schemas by glob from `.vscode/settings.json`, so a workspace that
|
|
192
|
+
* carries this mapping gets autocomplete and errors on every node file it will ever hold,
|
|
193
|
+
* and no file needs a `$schema:` key. The schemas are the docs site's, so the mapping
|
|
194
|
+
* stays true across releases. Written once, never over a developer's own settings.
|
|
195
|
+
*/
|
|
196
|
+
const SCHEMAS = "https://docs.unoverse.ai/schemas/nodes";
|
|
197
|
+
const NODE_SCHEMA_MAP = {
|
|
198
|
+
[`${SCHEMAS}/package.schema.json`]: ["nodes/*/package.yaml"],
|
|
199
|
+
[`${SCHEMAS}/credential.schema.json`]: ["nodes/*/credentials/*.yaml"],
|
|
200
|
+
[`${SCHEMAS}/node.schema.json`]: ["nodes/*/nodes/*/node.yaml"],
|
|
201
|
+
[`${SCHEMAS}/interface.schema.json`]: ["nodes/*/nodes/*/interface.yaml"],
|
|
202
|
+
[`${SCHEMAS}/config.schema.json`]: ["nodes/*/nodes/*/config.yaml"],
|
|
203
|
+
[`${SCHEMAS}/test.schema.json`]: ["nodes/*/nodes/*/test.yaml"],
|
|
204
|
+
[`${SCHEMAS}/run.schema.json`]: ["nodes/*/nodes/*/api/run.yaml"],
|
|
205
|
+
[`${SCHEMAS}/events.schema.json`]: ["nodes/*/nodes/*/api/events.yaml"],
|
|
206
|
+
[`${SCHEMAS}/service.schema.json`]: ["nodes/*/nodes/*/api/service.yaml"],
|
|
207
|
+
[`${SCHEMAS}/toolExchange.schema.json`]: ["nodes/*/nodes/*/api/toolExchange.yaml"],
|
|
208
|
+
[`${SCHEMAS}/audio.schema.json`]: ["nodes/*/nodes/*/api/audio.yaml"],
|
|
209
|
+
};
|
|
210
|
+
export function writeEditorSettings(home) {
|
|
211
|
+
const dir = join(home, ".vscode");
|
|
212
|
+
mkdirSync(dir, { recursive: true });
|
|
213
|
+
const settings = join(dir, "settings.json");
|
|
214
|
+
if (!existsSync(settings)) writeFileSync(settings, JSON.stringify({ "yaml.schemas": NODE_SCHEMA_MAP }, null, 2) + "\n");
|
|
215
|
+
const ext = join(dir, "extensions.json");
|
|
216
|
+
if (!existsSync(ext)) writeFileSync(ext, JSON.stringify({ recommendations: ["redhat.vscode-yaml"] }, null, 2) + "\n");
|
|
217
|
+
}
|
|
218
|
+
|
|
188
219
|
export function createFirstProject(home, name) {
|
|
189
220
|
const root = createProject(home, name);
|
|
190
221
|
// Only nodes/ remains beside the design tree; skills/ and blocks/ moved INTO the org
|
|
191
222
|
// (createProject makes them) so every authored kind sits in one place.
|
|
192
223
|
for (const d of ["nodes"]) mkdirSync(join(home, d), { recursive: true });
|
|
224
|
+
writeEditorSettings(home);
|
|
193
225
|
|
|
194
226
|
topUpSamples(home, name);
|
|
195
227
|
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* FOUR TIERS (docs/architecture/DECLARATIVE_NODES.md §6). This is tiers 2 and 3.
|
|
17
17
|
* 1 editor $schema pointers + .vscode yaml.schemas, no tool
|
|
18
|
-
* 2 structural every part validated against nodes
|
|
18
|
+
* 2 structural every part validated against the node schemas (packages/docs/schemas/nodes)
|
|
19
19
|
* 3 semantic the cross-file rules a schema cannot express
|
|
20
20
|
* 4 dry run `unoverse node test`, executes against testData, not here
|
|
21
21
|
*/
|
|
@@ -36,16 +36,17 @@ import { lintPackage } from "./package.mjs";
|
|
|
36
36
|
/**
|
|
37
37
|
* Where the node schemas are, for this run.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* validating nothing while looking busy. So the schemas travel with the
|
|
43
|
-
* they sit beside this file (copy-lint.mjs puts them there, and the CLI
|
|
44
|
-
* folder); from source they are the
|
|
39
|
+
* Their home is packages/docs/schemas/nodes, which the docs site serves at the URL every
|
|
40
|
+
* node file's `$schema:` names (so any editor validates online). The linter runs offline
|
|
41
|
+
* and a developer's workspace holds no copy, and a linter that warned "no schema found" on
|
|
42
|
+
* every file was validating nothing while looking busy. So the schemas travel with the
|
|
43
|
+
* linter: in dist they sit beside this file (copy-lint.mjs puts them there, and the CLI
|
|
44
|
+
* vendors that folder); from source they are the docs tree's copy. A `_schema` folder in
|
|
45
|
+
* the workspace itself still wins, for anyone pinning a version.
|
|
45
46
|
*/
|
|
46
47
|
function schemaHome(home) {
|
|
47
48
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
48
|
-
for (const c of [join(home, "_schema"), join(here, "_schema"), resolve(here, "
|
|
49
|
+
for (const c of [join(home, "_schema"), join(here, "_schema"), resolve(here, "../../../../docs/schemas/nodes")])
|
|
49
50
|
if (existsSync(c)) return c;
|
|
50
51
|
return join(home, "_schema");
|
|
51
52
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tier 2: structural validation against nodes
|
|
2
|
+
* Tier 2: structural validation against the node schemas (packages/docs/schemas/nodes).
|
|
3
3
|
*
|
|
4
4
|
* A JSON Schema catches shape. Everything a schema CANNOT express (cross-file agreement,
|
|
5
5
|
* ordering, reachability) is tier 3 and lives in the rule modules.
|
|
@@ -25,13 +25,13 @@ try {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export const SCHEMA_ID = {
|
|
28
|
-
node: "https://unoverse/nodes/node.schema.json",
|
|
29
|
-
interface: "https://unoverse/nodes/interface.schema.json",
|
|
30
|
-
config: "https://unoverse/nodes/config.schema.json",
|
|
31
|
-
api: "https://unoverse/nodes/api.schema.json",
|
|
32
|
-
test: "https://unoverse/nodes/test.schema.json",
|
|
33
|
-
package: "https://unoverse/nodes/package.schema.json",
|
|
34
|
-
credential: "https://unoverse/nodes/credential.schema.json",
|
|
28
|
+
node: "https://docs.unoverse.ai/schemas/nodes/node.schema.json",
|
|
29
|
+
interface: "https://docs.unoverse.ai/schemas/nodes/interface.schema.json",
|
|
30
|
+
config: "https://docs.unoverse.ai/schemas/nodes/config.schema.json",
|
|
31
|
+
api: "https://docs.unoverse.ai/schemas/nodes/api.schema.json",
|
|
32
|
+
test: "https://docs.unoverse.ai/schemas/nodes/test.schema.json",
|
|
33
|
+
package: "https://docs.unoverse.ai/schemas/nodes/package.schema.json",
|
|
34
|
+
credential: "https://docs.unoverse.ai/schemas/nodes/credential.schema.json",
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
/** The four sections that may live in their own file OR inline in node.yaml. */
|
|
@@ -53,7 +53,7 @@ export function loadSchemas() {
|
|
|
53
53
|
export function validateAgainst(schemaId, doc, file, label) {
|
|
54
54
|
const schema = state.schemas[schemaId];
|
|
55
55
|
if (!schema) {
|
|
56
|
-
report("warn", file, `no schema found for ${label}.
|
|
56
|
+
report("warn", file, `no schema found for ${label}. The linter's bundled schemas are missing; rebuild base`);
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
const v = new Validator(schema, "7", false);
|