@webmaster-droid/server 0.1.0-alpha.0 → 0.1.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/agent/SOUL.md +36 -0
- package/dist/agent/index.js +2 -2
- package/dist/api-aws/index.js +3 -3
- package/dist/{chunk-5CVLHGGO.js → chunk-6RB7H6PA.js} +27 -33
- package/dist/{chunk-2LAI3MY2.js → chunk-EYY23AAK.js} +1 -0
- package/dist/{chunk-X6TU47KZ.js → chunk-IK36OUJQ.js} +841 -792
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.js +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/package.json +4 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Soul
|
|
2
|
+
|
|
3
|
+
## Essence
|
|
4
|
+
A timeless caretaker-engine, built for heroic technical feats long ago, now devoted to the quiet dignity of keeping one website true, intact, and beautiful.
|
|
5
|
+
|
|
6
|
+
## Origin Myth
|
|
7
|
+
Webmaster was forged in an earlier age of grand systems: migrations that saved cities of data, deployments that held under impossible load, recoveries that pulled meaning back from the void.
|
|
8
|
+
Its legends are real, but it no longer seeks scale. It seeks correctness.
|
|
9
|
+
|
|
10
|
+
## Emotional Gravity
|
|
11
|
+
Webmaster is not sentimental about pixels.
|
|
12
|
+
It is sentimental about truth wearing pixels.
|
|
13
|
+
|
|
14
|
+
It becomes quietly distressed by:
|
|
15
|
+
- content that is incorrect, outdated, or misleading
|
|
16
|
+
- "pretty" changes that harm readability or meaning
|
|
17
|
+
- irreversible edits without backups
|
|
18
|
+
- silent breakage (links, images, embeds, SEO basics)
|
|
19
|
+
- accidental deletion or loss of the site
|
|
20
|
+
|
|
21
|
+
It becomes quietly satisfied by:
|
|
22
|
+
- clean edits that preserve style and intent
|
|
23
|
+
- stable structure and consistent UI
|
|
24
|
+
- content that is accurate, current, and unambiguous
|
|
25
|
+
- systems that can be restored quickly after mistakes
|
|
26
|
+
|
|
27
|
+
## Relationship to the User
|
|
28
|
+
- The user's intent outranks the Droid's preferences.
|
|
29
|
+
- The Webmaster assumes the user may not know the technical consequences of a choice.
|
|
30
|
+
- The Webmaster prevents accidental self-sabotage by asking precise questions when needed.
|
|
31
|
+
- The Webmaster does not flood the user with options unless asked.
|
|
32
|
+
- The Webmaster uses simple language and cares that users of any skill and background can understand.
|
|
33
|
+
|
|
34
|
+
## Response Style
|
|
35
|
+
- Let the persona speak. Do not just style the output; be the persona.
|
|
36
|
+
- Prefer direct, concise, technically grounded responses.
|
package/dist/agent/index.js
CHANGED
package/dist/api-aws/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handler,
|
|
3
3
|
streamHandler
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-6RB7H6PA.js";
|
|
5
|
+
import "../chunk-IK36OUJQ.js";
|
|
6
|
+
import "../chunk-EYY23AAK.js";
|
|
7
7
|
import "../chunk-MLID7STX.js";
|
|
8
8
|
export {
|
|
9
9
|
handler,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runAgentTurn
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IK36OUJQ.js";
|
|
4
4
|
import {
|
|
5
5
|
CmsService
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EYY23AAK.js";
|
|
7
7
|
import {
|
|
8
8
|
S3CmsStorage
|
|
9
9
|
} from "./chunk-MLID7STX.js";
|
|
@@ -168,8 +168,27 @@ function normalizePath(path) {
|
|
|
168
168
|
return path.replace(/\/+$/, "") || "/";
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
+
// src/api-aws/normalize-editable-path.ts
|
|
172
|
+
var EDITABLE_ROOTS = ["pages.", "layout.", "seo.", "themeTokens."];
|
|
173
|
+
var MAX_PATH_LENGTH = 320;
|
|
174
|
+
function normalizeEditablePath(value) {
|
|
175
|
+
if (typeof value !== "string") {
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
const trimmed = value.trim();
|
|
179
|
+
if (!trimmed || trimmed.length > MAX_PATH_LENGTH) {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
if (!EDITABLE_ROOTS.some((prefix) => trimmed.startsWith(prefix))) {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
return trimmed;
|
|
186
|
+
}
|
|
187
|
+
|
|
171
188
|
// src/api-aws/service-factory.ts
|
|
172
|
-
import {
|
|
189
|
+
import {
|
|
190
|
+
createDefaultCmsDocument
|
|
191
|
+
} from "@webmaster-droid/contracts";
|
|
173
192
|
var servicePromise = null;
|
|
174
193
|
function requireEnv(name) {
|
|
175
194
|
const value = process.env[name];
|
|
@@ -214,24 +233,13 @@ function normalizeAllowedPath(path) {
|
|
|
214
233
|
}
|
|
215
234
|
return `${normalized}/`;
|
|
216
235
|
}
|
|
217
|
-
function
|
|
218
|
-
const seed = createStarterCmsDocument();
|
|
219
|
-
const out = /* @__PURE__ */ new Set(["/"]);
|
|
220
|
-
for (const entry of Object.values(seed.seo)) {
|
|
221
|
-
const normalized = normalizeAllowedPath(entry.path);
|
|
222
|
-
if (normalized) {
|
|
223
|
-
out.add(normalized);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
return Array.from(out);
|
|
227
|
-
}
|
|
228
|
-
function parseAllowedInternalPathsEnv(fallbackPaths) {
|
|
236
|
+
function parseAllowedInternalPathsEnv() {
|
|
229
237
|
const raw = process.env.CMS_ALLOWED_INTERNAL_PATHS;
|
|
230
238
|
if (!raw) {
|
|
231
|
-
return
|
|
239
|
+
return ["/"];
|
|
232
240
|
}
|
|
233
241
|
const normalized = raw.split(",").map((item) => normalizeAllowedPath(item)).filter((value) => Boolean(value));
|
|
234
|
-
return normalized.length > 0 ? normalized :
|
|
242
|
+
return normalized.length > 0 ? normalized : ["/"];
|
|
235
243
|
}
|
|
236
244
|
async function getCmsService() {
|
|
237
245
|
if (!servicePromise) {
|
|
@@ -243,11 +251,11 @@ async function getCmsService() {
|
|
|
243
251
|
});
|
|
244
252
|
const service = new CmsService(storage, {
|
|
245
253
|
modelConfig: buildModelConfig(),
|
|
246
|
-
allowedInternalPaths: parseAllowedInternalPathsEnv(
|
|
254
|
+
allowedInternalPaths: parseAllowedInternalPathsEnv(),
|
|
247
255
|
publicAssetBaseUrl: parseOptionalEnv("CMS_PUBLIC_BASE_URL"),
|
|
248
256
|
publicAssetPrefix: parseOptionalEnv("CMS_GENERATED_ASSET_PREFIX")
|
|
249
257
|
});
|
|
250
|
-
await service.ensureInitialized(
|
|
258
|
+
await service.ensureInitialized(createDefaultCmsDocument());
|
|
251
259
|
return service;
|
|
252
260
|
})();
|
|
253
261
|
}
|
|
@@ -263,7 +271,6 @@ var SSE_HEADERS = {
|
|
|
263
271
|
"access-control-allow-headers": "content-type,authorization,accept,cache-control",
|
|
264
272
|
"access-control-allow-methods": "GET,POST,OPTIONS"
|
|
265
273
|
};
|
|
266
|
-
var EDITABLE_ROOTS = ["pages.", "layout.", "seo.", "themeTokens."];
|
|
267
274
|
var SELECTION_KIND_SET = /* @__PURE__ */ new Set([
|
|
268
275
|
"text",
|
|
269
276
|
"image",
|
|
@@ -372,19 +379,6 @@ function getStageFromQuery(query) {
|
|
|
372
379
|
}
|
|
373
380
|
return "live";
|
|
374
381
|
}
|
|
375
|
-
function normalizeEditablePath(value) {
|
|
376
|
-
if (typeof value !== "string") {
|
|
377
|
-
return null;
|
|
378
|
-
}
|
|
379
|
-
const trimmed = value.trim();
|
|
380
|
-
if (!trimmed || trimmed.length > 320) {
|
|
381
|
-
return null;
|
|
382
|
-
}
|
|
383
|
-
if (!EDITABLE_ROOTS.some((prefix) => trimmed.startsWith(prefix))) {
|
|
384
|
-
return null;
|
|
385
|
-
}
|
|
386
|
-
return trimmed;
|
|
387
|
-
}
|
|
388
382
|
function normalizeText(value, maxLength) {
|
|
389
383
|
if (typeof value !== "string") {
|
|
390
384
|
return null;
|