@simetrajs/designer 0.2.0 → 0.3.0-next.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/dist/{command-BCAw6Fsb.js → command-CHk1P9Dp.js} +42 -123
- package/dist/errors-D1P2kKbL.js +62 -0
- package/dist/{report-DV4deFdu.js → invoke-BwP_5iN6.js} +931 -314
- package/dist/main.js +4 -4
- package/dist/{mcp-ChltmHBb.js → mcp-jLOz0W7f.js} +26 -84
- package/dist/{package-Dg3MXPve.js → package-hA0J8AMK.js} +1 -1
- package/dist/{schema-engine-DPPnife2.js → schema-engine-8rVHcVYO.js} +627 -122
- package/dist/{types-iWavtmdS.js → types-CMcZhIci.js} +2 -0
- package/package.json +6 -3
- package/skills/simetra-adoption/SKILL.md +67 -2
- package/skills/simetra-metadata/SKILL.md +74 -87
- package/skills/simetra-metadata/references/agents-over-mcp.md +120 -3
- package/skills/simetra-metadata/references/attribute-load-and-size.md +57 -0
- package/skills/simetra-metadata/references/list-order-indexes.md +17 -0
- package/skills/simetra-metadata/references/object-modules.md +20 -2
- package/skills/simetra-metadata/references/people-and-rights.md +106 -14
- package/skills/simetra-metadata/references/plan-and-apply.md +81 -0
- package/skills/simetra-metadata/references/row-version-epoch.md +39 -0
- package/skills/simetra-metadata/references/search-fields.md +28 -0
- package/skills/simetra-metadata/references/sql-trust-boundary.md +41 -10
- package/dist/errors-Brw6UjAD.js +0 -35
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as version } from "./package-
|
|
3
|
-
import { n as TOOL_NAMES } from "./types-
|
|
2
|
+
import { t as version } from "./package-hA0J8AMK.js";
|
|
3
|
+
import { n as TOOL_NAMES } from "./types-CMcZhIci.js";
|
|
4
4
|
import { defineCommand, runCommand, runMain, showUsage } from "citty";
|
|
5
5
|
// src/main.ts
|
|
6
6
|
const main = defineCommand({
|
|
@@ -10,8 +10,8 @@ const main = defineCommand({
|
|
|
10
10
|
description: "Simetra metadata tooling"
|
|
11
11
|
},
|
|
12
12
|
subCommands: {
|
|
13
|
-
...Object.fromEntries(TOOL_NAMES.map((name) => [name, () => import("./command-
|
|
14
|
-
mcp: () => import("./mcp-
|
|
13
|
+
...Object.fromEntries(TOOL_NAMES.map((name) => [name, () => import("./command-CHk1P9Dp.js").then((m) => m.commandByName(name))])),
|
|
14
|
+
mcp: () => import("./mcp-jLOz0W7f.js").then((m) => m.default),
|
|
15
15
|
init: () => import("./init-jr0Xsrpp.js").then((m) => m.default)
|
|
16
16
|
}
|
|
17
17
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { d as parseDataLaunch, f as databaseResource, i as structureOf, l as checkEnvName, n as TOOLS, o as formatDiagnostics, r as presentation, t as invoke, u as dataResource } from "./invoke-BwP_5iN6.js";
|
|
3
3
|
import { a as dataWriteHint, l as readOnlyHint, n as trimSlash, o as databaseWriteHint, p as UsageError, r as ALLOW_RIGHTS_WRITE_FLAG } from "./default-dir-DerxTbci.js";
|
|
4
|
-
import { t as version } from "./package-
|
|
4
|
+
import { t as version } from "./package-hA0J8AMK.js";
|
|
5
5
|
import { t as mcpArgs } from "./mcp-args-D63akJ97.js";
|
|
6
6
|
import { defineCommand } from "citty";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -36,7 +36,7 @@ function lineFor(c, written) {
|
|
|
36
36
|
return `${c.deleted ? "would delete" : "would write"} ${c.path}`;
|
|
37
37
|
}
|
|
38
38
|
function toResponse(tool, result, o, dry) {
|
|
39
|
-
const { ok, written, changes, diagnostics, refusal } = result;
|
|
39
|
+
const { ok, written, wouldWrite, changes, diagnostics, refusal, artifacts } = result;
|
|
40
40
|
if (refusal !== void 0) return {
|
|
41
41
|
isError: true,
|
|
42
42
|
structuredContent: {
|
|
@@ -54,110 +54,52 @@ function toResponse(tool, result, o, dry) {
|
|
|
54
54
|
text: refusal.message
|
|
55
55
|
}]
|
|
56
56
|
};
|
|
57
|
-
if ((tool.name === "data-read" || tool.name === "data-command") && result.data !== void 0) {
|
|
58
|
-
const data = result.data;
|
|
59
|
-
return {
|
|
60
|
-
isError: !ok,
|
|
61
|
-
structuredContent: {
|
|
62
|
-
ok,
|
|
63
|
-
diagnostics,
|
|
64
|
-
...toJson(data)
|
|
65
|
-
},
|
|
66
|
-
content: [{
|
|
67
|
-
type: "text",
|
|
68
|
-
text: summarizeData(tool.name, data)
|
|
69
|
-
}]
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
if (tool.name === "explain" && ok && result.data !== void 0) return {
|
|
73
|
-
structuredContent: { ...result.data },
|
|
74
|
-
content: [{
|
|
75
|
-
type: "text",
|
|
76
|
-
text: JSON.stringify(result.data, null, 2)
|
|
77
|
-
}]
|
|
78
|
-
};
|
|
79
57
|
const report = formatDiagnostics(diagnostics, {
|
|
80
58
|
dir: o.dir,
|
|
81
59
|
locale: "en",
|
|
82
60
|
format: "text"
|
|
83
61
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const data = result.data;
|
|
102
|
-
return {
|
|
103
|
-
isError: !ok,
|
|
104
|
-
structuredContent: {
|
|
105
|
-
ok,
|
|
106
|
-
written,
|
|
107
|
-
artifacts: result.artifacts ?? [],
|
|
108
|
-
diagnostics,
|
|
109
|
-
...data
|
|
110
|
-
},
|
|
111
|
-
content: [{
|
|
112
|
-
type: "text",
|
|
113
|
-
text: renderPlan(data, report, {
|
|
114
|
-
ok,
|
|
115
|
-
written
|
|
116
|
-
})
|
|
117
|
-
}]
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
if (tool.name === "apply") {
|
|
121
|
-
const data = result.data;
|
|
122
|
-
return {
|
|
123
|
-
isError: !ok,
|
|
124
|
-
structuredContent: {
|
|
125
|
-
ok,
|
|
126
|
-
written,
|
|
127
|
-
artifacts: result.artifacts ?? [],
|
|
128
|
-
diagnostics,
|
|
129
|
-
...data
|
|
130
|
-
},
|
|
131
|
-
content: [{
|
|
132
|
-
type: "text",
|
|
133
|
-
text: renderApply(data, diagnostics, report)
|
|
134
|
-
}]
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
const record = tool.name === "promote" ? result.data : void 0;
|
|
62
|
+
const view = {
|
|
63
|
+
channel: "mcp",
|
|
64
|
+
ok,
|
|
65
|
+
written,
|
|
66
|
+
diagnostics,
|
|
67
|
+
report
|
|
68
|
+
};
|
|
69
|
+
const present = tool.present;
|
|
70
|
+
const { shown, data: shownData } = presentation(tool, result);
|
|
71
|
+
if (present?.bare === true && shown) return {
|
|
72
|
+
structuredContent: { ...structureOf(tool, shownData) },
|
|
73
|
+
content: [{
|
|
74
|
+
type: "text",
|
|
75
|
+
text: present.text?.(shownData, view) ?? ""
|
|
76
|
+
}]
|
|
77
|
+
};
|
|
78
|
+
const text = shown ? present?.text?.(shownData, view) : void 0;
|
|
138
79
|
const databaseFailed = diagnostics.some((d) => d.code === "database.failed");
|
|
139
80
|
const databaseUnreadable = diagnostics.some((d) => d.code === "engine.owner-not-member");
|
|
140
81
|
const lines = ok ? [
|
|
141
82
|
...changes.map((c) => lineFor(c, written)),
|
|
142
83
|
...dry && tool.files === "write" ? ["dry run: nothing written"] : [],
|
|
143
84
|
...tool.files === "read" ? [`${tool.name}: no errors`] : []
|
|
144
|
-
] : databaseFailed ? [`${tool.files === "write" ? "nothing written" : tool.name}: the database work failed`] : databaseUnreadable ? [`${tool.name}: the database has objects the engine cannot read`] : tool.files === "write" ? ["nothing written: the operation was refused or the result has errors"] : [`${tool.name}: the metadata has errors`];
|
|
85
|
+
] : databaseFailed ? [`${tool.files === "write" ? "nothing written" : tool.name}: the database work failed`] : databaseUnreadable ? [`${tool.name}: the database has objects the engine cannot read`] : tool.files === "write" ? [written ? "written: the result keeps only repair-class errors the directory already had" : wouldWrite === true ? "would write: the result keeps only repair-class errors the directory already had" : "nothing written: the operation was refused or the result has errors"] : [`${tool.name}: the metadata has errors`];
|
|
145
86
|
return {
|
|
146
87
|
isError: !ok,
|
|
147
88
|
structuredContent: {
|
|
148
89
|
ok,
|
|
149
90
|
written,
|
|
91
|
+
...wouldWrite === true ? { wouldWrite } : {},
|
|
150
92
|
changes,
|
|
93
|
+
...tool.files === "artifact" ? { artifacts: artifacts ?? [] } : {},
|
|
151
94
|
diagnostics,
|
|
152
|
-
...
|
|
153
|
-
...record === void 0 ? {} : { record }
|
|
95
|
+
...shownData !== void 0 ? structureOf(tool, shownData) : {}
|
|
154
96
|
},
|
|
155
97
|
content: [{
|
|
156
98
|
type: "text",
|
|
157
|
-
text: [
|
|
99
|
+
text: text ?? [
|
|
158
100
|
...lines,
|
|
159
101
|
report,
|
|
160
|
-
...
|
|
102
|
+
...shownData !== void 0 && present?.appendix !== void 0 ? [present.appendix(shownData, view)] : []
|
|
161
103
|
].join("\n")
|
|
162
104
|
}]
|
|
163
105
|
};
|