@hamak/smart-data-dico 1.18.0 → 1.18.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/backend/dist/server.mjs +20 -0
- package/package.json +1 -1
package/backend/dist/server.mjs
CHANGED
|
@@ -82888,6 +82888,22 @@ var init_dist6 = __esm({
|
|
|
82888
82888
|
}
|
|
82889
82889
|
});
|
|
82890
82890
|
|
|
82891
|
+
// backend/src/services/ai/authoringRules.ts
|
|
82892
|
+
var AUTHORING_RULES;
|
|
82893
|
+
var init_authoringRules = __esm({
|
|
82894
|
+
"backend/src/services/ai/authoringRules.ts"() {
|
|
82895
|
+
"use strict";
|
|
82896
|
+
AUTHORING_RULES = `AUTHORING RULES \u2014 Smart Data Dictionary file format. Follow exactly when creating or changing model elements (prefer the dedicated tools; these rules govern what a valid result looks like):
|
|
82897
|
+
|
|
82898
|
+
- UUIDs: every entity, attribute (including nested properties/items), relationship, rule, and case has a real UUID (v1\u2013v5). Never hand-type hex \u2014 the tools generate them. Identifiers are unique across the WHOLE package, not per file: a duplicate entity name, or a duplicate rule/case/relationship UUID anywhere in the package, is a hard load error.
|
|
82899
|
+
- References are UUID-based, never name-based, so renames don't break links. Every reference (relationship ends, rule targets, action/state-machine ownerRef) must resolve within the package.
|
|
82900
|
+
- Keep the three governance concepts SEPARATE \u2014 never collapse them: Validation (attribute.validation \u2014 pattern, maxLength, enumValues, minimum\u2026) vs Constraint (entity.constraints[] \u2014 unique, check, foreignKey, index; DB-enforced) vs Rule (a first-class business invariant across fields/lifecycle). type: enum \u2192 allowed values live in validation.enumValues, not a separate field.
|
|
82901
|
+
- Conceptual vs physical stay distinct: author logical names (PascalCase entities, camelCase attributes, logical/derived types); physical.* holds table/column names and dbTypes. Never write SQL/DDL with conceptual names.
|
|
82902
|
+
- Reserved metadata keys you may set on an element: system.hidden ("true" hides it from lists/diagrams/exports; "false" pins it visible over any rule) and system.style (a defined Element Style name \u2192 styles it in diagrams). Prefer the hide / element-style tools over writing these metadata keys directly.
|
|
82903
|
+
- Project config in dico.config.json carries: types[] (reusable derived attribute types), hideRules[] (glob/regex that bulk-hide reverse-engineering waste), and elementStyles[] + styleRules[] (named diagram styles bound to roles). Manage these with the dedicated tools (createDerivedType, defineElementStyle, addStyleRule) rather than editing config blindly.`;
|
|
82904
|
+
}
|
|
82905
|
+
});
|
|
82906
|
+
|
|
82891
82907
|
// backend/src/utils/appDir.ts
|
|
82892
82908
|
import fs from "fs";
|
|
82893
82909
|
import path8 from "path";
|
|
@@ -116532,6 +116548,9 @@ function sqlSettingsInstruction(cfg) {
|
|
|
116532
116548
|
function buildSystemPrompt(pageContext, conversationSystemPrompt, mode = "designer", modelOutline, sqlInstruction) {
|
|
116533
116549
|
const base = typeof conversationSystemPrompt === "string" && conversationSystemPrompt.trim().length > 0 ? conversationSystemPrompt.trim().slice(0, 8e3) : SYSTEM_PROMPT;
|
|
116534
116550
|
let out = base + getModeSystemSuffix(mode);
|
|
116551
|
+
if (mode === "designer") out += `
|
|
116552
|
+
|
|
116553
|
+
${AUTHORING_RULES}`;
|
|
116535
116554
|
if (typeof sqlInstruction === "string" && sqlInstruction.trim().length > 0) {
|
|
116536
116555
|
out += `
|
|
116537
116556
|
|
|
@@ -116883,6 +116902,7 @@ var init_aiController = __esm({
|
|
|
116883
116902
|
init_logger();
|
|
116884
116903
|
init_config();
|
|
116885
116904
|
init_agentToolRegistry();
|
|
116905
|
+
init_authoringRules();
|
|
116886
116906
|
init_appDir();
|
|
116887
116907
|
init_conversationService();
|
|
116888
116908
|
init_promptService();
|