@xtrable-ltd/nanoesis 0.1.33 → 0.1.35
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/adapter-azure-blob.d.ts +39 -5
- package/dist/adapter-azure-blob.js +72 -19
- package/dist/{chunk-P6NDWIKK.js → chunk-GWK7KV2Z.js} +15 -4
- package/dist/{chunk-C3QPGXG5.js → chunk-K6WMGWIF.js} +1 -1
- package/dist/editor-api.js +2 -2
- package/dist/index.js +1 -1
- package/dist/mcp.js +3 -3
- package/editor/assets/{MigrationsPane-BuaKhsie.js → MigrationsPane-CyoVYzF0.js} +1 -1
- package/editor/assets/{TemplatesPane-Bg_b0htA.js → TemplatesPane-DpsCh-o4.js} +8 -8
- package/editor/assets/{cssMode-Bcwjp8T3.js → cssMode-BAqMF74N.js} +1 -1
- package/editor/assets/{freemarker2-Cgqj3dEx.js → freemarker2-CwSWbc4F.js} +1 -1
- package/editor/assets/{handlebars-CLf2-RZf.js → handlebars-Bsu2MfUx.js} +1 -1
- package/editor/assets/{html-BrWGWRh6.js → html-CBiUJhK7.js} +1 -1
- package/editor/assets/{htmlMode-D9skx8gp.js → htmlMode-CpcJVgL-.js} +1 -1
- package/editor/assets/{index-CY5Kehuu.js → index-DcIPxwAD.js} +70 -70
- package/editor/assets/{javascript-KaABDboM.js → javascript-8DiMKs99.js} +1 -1
- package/editor/assets/{jsonMode-0usLs2ME.js → jsonMode-DXHVjz3Z.js} +1 -1
- package/editor/assets/{liquid-DYna-Clp.js → liquid-B2vMjkXF.js} +1 -1
- package/editor/assets/{mdx-f7LAIls6.js → mdx-Di8mcbBz.js} +1 -1
- package/editor/assets/{python-Bh21_mvq.js → python-B14f4cy5.js} +1 -1
- package/editor/assets/{razor-D_530Ymg.js → razor-Bia-zZON.js} +1 -1
- package/editor/assets/{tsMode-CTRVjt9n.js → tsMode-DYYHZehT.js} +1 -1
- package/editor/assets/{typescript-D084tkOf.js → typescript-DSAquhra.js} +1 -1
- package/editor/assets/{xml-BFulX1C6.js → xml-T7SznOD_.js} +1 -1
- package/editor/assets/{yaml-CgZsYmUt.js → yaml-CfKxtDta.js} +1 -1
- package/editor/index.html +1 -1
- package/package.json +1 -1
|
@@ -23,11 +23,23 @@ interface BlobContainer {
|
|
|
23
23
|
/**
|
|
24
24
|
* Create or overwrite a blob with the given bytes and content type. `cacheControl`, when
|
|
25
25
|
* given, is stored as the blob's `Cache-Control` so a static-website read serves the right
|
|
26
|
-
* freshness (DESIGN §11); omitted for the editor's working blobs.
|
|
26
|
+
* freshness (DESIGN §11); omitted for the editor's working blobs. `hash`, when given, is
|
|
27
|
+
* stored as blob metadata (`nanohash`) so a later publish can tell whether the content is
|
|
28
|
+
* unchanged and skip the upload (see docs/change-detection-on-publish.md); a write *without*
|
|
29
|
+
* a `hash` clears any prior stored hash, matching Azure's overwrite-replaces-metadata
|
|
30
|
+
* semantics, so a stale hash can never outlive the bytes it described.
|
|
27
31
|
*/
|
|
28
|
-
write(name: string, data: Uint8Array, contentType: string, cacheControl?: string): Promise<void>;
|
|
32
|
+
write(name: string, data: Uint8Array, contentType: string, cacheControl?: string, hash?: string): Promise<void>;
|
|
29
33
|
/** Delete a blob; a missing blob is a no-op (idempotent). */
|
|
30
34
|
remove(name: string): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Every blob name beginning with `prefix` mapped to its stored content hash (the `nanohash`
|
|
37
|
+
* metadata, `undefined` for a blob written without one), for change detection on publish.
|
|
38
|
+
* Reads metadata from the same listing as {@link list} (one round trip, no blob bodies), so
|
|
39
|
+
* a host can diff a candidate artifact's hash against what is live and skip an unchanged
|
|
40
|
+
* upload. Sorted by name, like {@link list}, to keep any downstream walk deterministic.
|
|
41
|
+
*/
|
|
42
|
+
listWithHashes(prefix: string): Promise<ReadonlyMap<string, string | undefined>>;
|
|
31
43
|
/**
|
|
32
44
|
* A blob's bytes plus its current version tag (the Azure ETag), or null if absent. Pairs
|
|
33
45
|
* with {@link writeConditional} for the optimistic-concurrency the content index needs
|
|
@@ -53,6 +65,8 @@ interface BlobContainer {
|
|
|
53
65
|
declare class InMemoryBlobContainer implements BlobContainer {
|
|
54
66
|
private readonly blobs;
|
|
55
67
|
private readonly cacheControls;
|
|
68
|
+
/** Per-blob `nanohash` metadata, the in-memory stand-in for the real blob metadata. */
|
|
69
|
+
private readonly hashes;
|
|
56
70
|
/** Per-blob version, bumped on every write, the in-memory stand-in for an ETag. */
|
|
57
71
|
private readonly versions;
|
|
58
72
|
private nextVersion;
|
|
@@ -60,8 +74,9 @@ declare class InMemoryBlobContainer implements BlobContainer {
|
|
|
60
74
|
private store;
|
|
61
75
|
list(prefix: string): Promise<readonly string[]>;
|
|
62
76
|
read(name: string): Promise<Uint8Array | null>;
|
|
63
|
-
write(name: string, data: Uint8Array, contentType?: string, cacheControl?: string): Promise<void>;
|
|
77
|
+
write(name: string, data: Uint8Array, contentType?: string, cacheControl?: string, hash?: string): Promise<void>;
|
|
64
78
|
remove(name: string): Promise<void>;
|
|
79
|
+
listWithHashes(prefix: string): Promise<ReadonlyMap<string, string | undefined>>;
|
|
65
80
|
readVersioned(name: string): Promise<{
|
|
66
81
|
bytes: Uint8Array;
|
|
67
82
|
version: string;
|
|
@@ -71,6 +86,8 @@ declare class InMemoryBlobContainer implements BlobContainer {
|
|
|
71
86
|
get names(): readonly string[];
|
|
72
87
|
/** Test helper: the `Cache-Control` a blob was written with, if any. */
|
|
73
88
|
cacheControlOf(name: string): string | undefined;
|
|
89
|
+
/** Test helper: the `nanohash` metadata a blob was written with, if any. */
|
|
90
|
+
hashOf(name: string): string | undefined;
|
|
74
91
|
}
|
|
75
92
|
|
|
76
93
|
/**
|
|
@@ -88,8 +105,9 @@ declare class AzureBlobContainer implements BlobContainer {
|
|
|
88
105
|
/** Create the container if it does not exist (idempotent host start-up step). */
|
|
89
106
|
ensureContainer(): Promise<void>;
|
|
90
107
|
list(prefix: string): Promise<readonly string[]>;
|
|
108
|
+
listWithHashes(prefix: string): Promise<ReadonlyMap<string, string | undefined>>;
|
|
91
109
|
read(name: string): Promise<Uint8Array | null>;
|
|
92
|
-
write(name: string, data: Uint8Array, contentType: string, cacheControl?: string): Promise<void>;
|
|
110
|
+
write(name: string, data: Uint8Array, contentType: string, cacheControl?: string, hash?: string): Promise<void>;
|
|
93
111
|
remove(name: string): Promise<void>;
|
|
94
112
|
readVersioned(name: string): Promise<{
|
|
95
113
|
bytes: Uint8Array;
|
|
@@ -133,6 +151,19 @@ declare class BlobArtifactSink implements ArtifactSink {
|
|
|
133
151
|
write(path: string, contents: string | Uint8Array, cacheControl?: string): Promise<void>;
|
|
134
152
|
}
|
|
135
153
|
|
|
154
|
+
/** Options for {@link azureStorage}. */
|
|
155
|
+
interface AzureStorageOptions {
|
|
156
|
+
/**
|
|
157
|
+
* Skip re-uploading a blob whose content is byte-identical to what is already stored
|
|
158
|
+
* (docs/change-detection-on-publish.md). On every `put` the store hashes the bytes and
|
|
159
|
+
* compares against the live `nanohash` metadata (read once per publish, no blob bodies);
|
|
160
|
+
* an unchanged blob is not written, a changed/new one is written and re-stamped. Default
|
|
161
|
+
* **off**, so existing behaviour (always write) is unchanged. Enable it only on the
|
|
162
|
+
* **published** container, never the working store, whose conditional index writes must
|
|
163
|
+
* not be skipped.
|
|
164
|
+
*/
|
|
165
|
+
readonly changeDetection?: boolean;
|
|
166
|
+
}
|
|
136
167
|
/**
|
|
137
168
|
* A ready-made {@link Storage} over an Azure Blob container: get/put/delete (via
|
|
138
169
|
* {@link BlobContainerStore}) plus `wipe` (delete every blob) and `prune` (delete every blob
|
|
@@ -140,8 +171,11 @@ declare class BlobArtifactSink implements ArtifactSink {
|
|
|
140
171
|
* as `editorFiles` (the working container) and `website` (the published `$web` container).
|
|
141
172
|
* For the working container, also pass `enumerate: () => container.list('')` so the editor
|
|
142
173
|
* can reconcile its content index.
|
|
174
|
+
*
|
|
175
|
+
* Pass `{ changeDetection: true }` on the **published** container to skip uploads of unchanged
|
|
176
|
+
* blobs (see {@link AzureStorageOptions.changeDetection}).
|
|
143
177
|
*/
|
|
144
|
-
declare function azureStorage(container: BlobContainer): Storage & ConditionalBlobStore;
|
|
178
|
+
declare function azureStorage(container: BlobContainer, options?: AzureStorageOptions): Storage & ConditionalBlobStore;
|
|
145
179
|
|
|
146
180
|
/**
|
|
147
181
|
* Pure path/name helper for the blob adapters. Blob storage is a *flat* namespace, a blob
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
+
contentHash,
|
|
2
3
|
contentTypeFor
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GWK7KV2Z.js";
|
|
4
5
|
|
|
5
6
|
// ../../adapters/azure-blob/src/container.ts
|
|
6
7
|
var InMemoryBlobContainer = class {
|
|
7
8
|
blobs = /* @__PURE__ */ new Map();
|
|
8
9
|
cacheControls = /* @__PURE__ */ new Map();
|
|
10
|
+
/** Per-blob `nanohash` metadata, the in-memory stand-in for the real blob metadata. */
|
|
11
|
+
hashes = /* @__PURE__ */ new Map();
|
|
9
12
|
/** Per-blob version, bumped on every write, the in-memory stand-in for an ETag. */
|
|
10
13
|
versions = /* @__PURE__ */ new Map();
|
|
11
14
|
nextVersion = 1;
|
|
@@ -31,14 +34,22 @@ var InMemoryBlobContainer = class {
|
|
|
31
34
|
async read(name) {
|
|
32
35
|
return this.blobs.get(name) ?? null;
|
|
33
36
|
}
|
|
34
|
-
async write(name, data, contentType, cacheControl) {
|
|
37
|
+
async write(name, data, contentType, cacheControl, hash) {
|
|
35
38
|
void contentType;
|
|
36
39
|
this.store(name, data);
|
|
37
40
|
if (cacheControl !== void 0) this.cacheControls.set(name, cacheControl);
|
|
41
|
+
if (hash !== void 0) this.hashes.set(name, hash);
|
|
42
|
+
else this.hashes.delete(name);
|
|
38
43
|
}
|
|
39
44
|
async remove(name) {
|
|
40
45
|
this.blobs.delete(name);
|
|
41
46
|
this.versions.delete(name);
|
|
47
|
+
this.hashes.delete(name);
|
|
48
|
+
}
|
|
49
|
+
async listWithHashes(prefix) {
|
|
50
|
+
const out = /* @__PURE__ */ new Map();
|
|
51
|
+
for (const name of await this.list(prefix)) out.set(name, this.hashes.get(name));
|
|
52
|
+
return out;
|
|
42
53
|
}
|
|
43
54
|
async readVersioned(name) {
|
|
44
55
|
const bytes = this.blobs.get(name);
|
|
@@ -60,6 +71,10 @@ var InMemoryBlobContainer = class {
|
|
|
60
71
|
cacheControlOf(name) {
|
|
61
72
|
return this.cacheControls.get(name);
|
|
62
73
|
}
|
|
74
|
+
/** Test helper: the `nanohash` metadata a blob was written with, if any. */
|
|
75
|
+
hashOf(name) {
|
|
76
|
+
return this.hashes.get(name);
|
|
77
|
+
}
|
|
63
78
|
};
|
|
64
79
|
|
|
65
80
|
// ../../adapters/azure-blob/src/azure-container.ts
|
|
@@ -95,6 +110,14 @@ var AzureBlobContainer = class _AzureBlobContainer {
|
|
|
95
110
|
}
|
|
96
111
|
return names.sort();
|
|
97
112
|
}
|
|
113
|
+
async listWithHashes(prefix) {
|
|
114
|
+
const entries = [];
|
|
115
|
+
for await (const blob of this.client.listBlobsFlat({ prefix, includeMetadata: true })) {
|
|
116
|
+
entries.push([blob.name, blob.metadata?.["nanohash"]]);
|
|
117
|
+
}
|
|
118
|
+
entries.sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
119
|
+
return new Map(entries);
|
|
120
|
+
}
|
|
98
121
|
async read(name) {
|
|
99
122
|
try {
|
|
100
123
|
const buffer = await this.client.getBlockBlobClient(name).downloadToBuffer();
|
|
@@ -104,12 +127,16 @@ var AzureBlobContainer = class _AzureBlobContainer {
|
|
|
104
127
|
throw error;
|
|
105
128
|
}
|
|
106
129
|
}
|
|
107
|
-
async write(name, data, contentType, cacheControl) {
|
|
130
|
+
async write(name, data, contentType, cacheControl, hash) {
|
|
108
131
|
await this.client.getBlockBlobClient(name).uploadData(Buffer.from(data), {
|
|
109
132
|
blobHTTPHeaders: {
|
|
110
133
|
blobContentType: contentType,
|
|
111
134
|
...cacheControl !== void 0 && { blobCacheControl: cacheControl }
|
|
112
|
-
}
|
|
135
|
+
},
|
|
136
|
+
// Stamp the content hash as metadata for change detection on the next publish. Azure
|
|
137
|
+
// lowercases metadata keys, so the key is already lowercase. An upload with no `hash`
|
|
138
|
+
// omits metadata, which (since uploadData replaces the blob) clears any prior hash.
|
|
139
|
+
...hash !== void 0 && { metadata: { nanohash: hash } }
|
|
113
140
|
});
|
|
114
141
|
}
|
|
115
142
|
async remove(name) {
|
|
@@ -200,32 +227,58 @@ var BlobArtifactSink = class {
|
|
|
200
227
|
};
|
|
201
228
|
|
|
202
229
|
// ../../adapters/azure-blob/src/azure-storage.ts
|
|
203
|
-
function azureStorage(container) {
|
|
230
|
+
function azureStorage(container, options = {}) {
|
|
204
231
|
const store = new BlobContainerStore(container);
|
|
205
|
-
|
|
232
|
+
const wipe = async () => {
|
|
233
|
+
for (const name of await container.list("")) await container.remove(name);
|
|
234
|
+
};
|
|
235
|
+
const prune = async (keep) => {
|
|
236
|
+
for (const name of await container.list("")) {
|
|
237
|
+
if (!keep.has(name)) await container.remove(name);
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
const common = {
|
|
206
241
|
get: (key) => store.get(key),
|
|
207
|
-
// Forward `cacheControl` (DESIGN §11): this is the published-site sink `createEditor`
|
|
208
|
-
// actually wires (`asSink(azureStorage(website))`), so dropping the arg here silently
|
|
209
|
-
// strips the publish Cache-Control before it reaches the blob.
|
|
210
|
-
put: (key, bytes, cacheControl) => store.put(key, bytes, cacheControl),
|
|
211
242
|
delete: (key) => store.delete(key),
|
|
212
243
|
// Optimistic-concurrency capability (DESIGN §11d): surfaced so a horizontally-scaled
|
|
213
244
|
// host's IndexedStore compare-and-sets the content index instead of blind-overwriting
|
|
214
245
|
// it, which is what stops two instances losing each other's updates
|
|
215
246
|
// (NANOESIS-MCP-ISSUES Issue 1). Azure blobs back this with native ETag conditions.
|
|
216
247
|
getVersioned: (key) => store.getVersioned(key),
|
|
217
|
-
putConditional: (key, bytes, expected) => store.putConditional(key, bytes, expected)
|
|
248
|
+
putConditional: (key, bytes, expected) => store.putConditional(key, bytes, expected)
|
|
249
|
+
};
|
|
250
|
+
if (!options.changeDetection) {
|
|
251
|
+
return {
|
|
252
|
+
...common,
|
|
253
|
+
// Forward `cacheControl` (DESIGN §11): this is the published-site sink `createEditor`
|
|
254
|
+
// actually wires (`asSink(azureStorage(website))`), so dropping the arg here silently
|
|
255
|
+
// strips the publish Cache-Control before it reaches the blob.
|
|
256
|
+
put: (key, bytes, cacheControl) => store.put(key, bytes, cacheControl),
|
|
257
|
+
wipe,
|
|
258
|
+
prune
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
let live = null;
|
|
262
|
+
const reset = () => {
|
|
263
|
+
live = null;
|
|
264
|
+
};
|
|
265
|
+
return {
|
|
266
|
+
...common,
|
|
267
|
+
put: async (key, bytes, cacheControl) => {
|
|
268
|
+
if (live === null) live = new Map(await container.listWithHashes(""));
|
|
269
|
+
const name = normalizeBlobName(key);
|
|
270
|
+
const hash = contentHash(bytes);
|
|
271
|
+
if (live.get(name) === hash) return;
|
|
272
|
+
await container.write(name, bytes, contentTypeFor(name), cacheControl, hash);
|
|
273
|
+
live.set(name, hash);
|
|
274
|
+
},
|
|
218
275
|
wipe: async () => {
|
|
219
|
-
|
|
276
|
+
await wipe();
|
|
277
|
+
reset();
|
|
220
278
|
},
|
|
221
|
-
// Zero-downtime sweep (DESIGN §11): the publish overwrites every artifact in place, then
|
|
222
|
-
// calls this with the just-written path set so only orphaned blobs (pages the new publish
|
|
223
|
-
// did not emit) are removed. Every live URL keeps serving throughout, the old wipe-first
|
|
224
|
-
// path blanked the whole site for the upload window.
|
|
225
279
|
prune: async (keep) => {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
280
|
+
await prune(keep);
|
|
281
|
+
reset();
|
|
229
282
|
}
|
|
230
283
|
};
|
|
231
284
|
}
|
|
@@ -2151,6 +2151,9 @@ function urlForItem(contentPath) {
|
|
|
2151
2151
|
const dirSegments = segments[segments.length - 1] === "index" ? segments.slice(0, -1) : segments;
|
|
2152
2152
|
return dirSegments.length === 0 ? "/" : `/${dirSegments.join("/")}/`;
|
|
2153
2153
|
}
|
|
2154
|
+
function siteUrl(baseUrl) {
|
|
2155
|
+
return baseUrl === void 0 ? "" : baseUrl.replace(/\/+$/, "");
|
|
2156
|
+
}
|
|
2154
2157
|
|
|
2155
2158
|
// ../engine/src/compile/site.ts
|
|
2156
2159
|
var DEFAULT_IMAGE_CONCURRENCY = 4;
|
|
@@ -2292,7 +2295,7 @@ async function compileSite(source, options = {}) {
|
|
|
2292
2295
|
const templateScript = await getScript(templateName);
|
|
2293
2296
|
const contents = compileTemplate({
|
|
2294
2297
|
template,
|
|
2295
|
-
scope: buildScope(node.item),
|
|
2298
|
+
scope: buildScope(node.item, { path: node.path, baseUrl }),
|
|
2296
2299
|
components,
|
|
2297
2300
|
context,
|
|
2298
2301
|
media: resolverFor(refs, imageInfoByPublished, fileUrlByPublished),
|
|
@@ -2365,7 +2368,9 @@ async function compilePage(source, itemPath, options = {}) {
|
|
|
2365
2368
|
}
|
|
2366
2369
|
const html = compileTemplate({
|
|
2367
2370
|
template,
|
|
2368
|
-
|
|
2371
|
+
// The preview has no site config loaded, so `{site_url}` degrades to empty
|
|
2372
|
+
// while `{url}` still resolves from the item's path (the brief's preview path).
|
|
2373
|
+
scope: buildScope(item, { path: node.path, baseUrl: void 0 }),
|
|
2369
2374
|
components,
|
|
2370
2375
|
context: buildResolveContext(tree),
|
|
2371
2376
|
media,
|
|
@@ -2533,13 +2538,14 @@ function assetRefs(value) {
|
|
|
2533
2538
|
return value.filter((entry) => typeof entry === "string");
|
|
2534
2539
|
return [];
|
|
2535
2540
|
}
|
|
2536
|
-
function buildScope(item) {
|
|
2541
|
+
function buildScope(item, page) {
|
|
2537
2542
|
return {
|
|
2538
2543
|
...item.fields,
|
|
2539
2544
|
title: item.title,
|
|
2540
2545
|
...item.created !== void 0 && { created: item.created },
|
|
2541
2546
|
...item.published !== void 0 && { published: item.published },
|
|
2542
|
-
...item.updated !== void 0 && { updated: item.updated }
|
|
2547
|
+
...item.updated !== void 0 && { updated: item.updated },
|
|
2548
|
+
...page !== void 0 && { url: urlForItem(page.path), site_url: siteUrl(page.baseUrl) }
|
|
2543
2549
|
};
|
|
2544
2550
|
}
|
|
2545
2551
|
function indexTree(tree) {
|
|
@@ -2698,6 +2704,11 @@ function tokensSection() {
|
|
|
2698
2704
|
name: "{item} and {item.field}",
|
|
2699
2705
|
summary: "Inside a loop, the current item: {item} is its URL, and {item.title} (or any field) is its content.",
|
|
2700
2706
|
example: '<a href="{item}">{item.title}</a>'
|
|
2707
|
+
},
|
|
2708
|
+
{
|
|
2709
|
+
name: "{url} and {site_url}",
|
|
2710
|
+
summary: "The current page\u2019s own location. {url} is its root-relative URL with a trailing slash (the form {item} yields); {site_url} is the configured site origin with no trailing slash (empty when none is set). Compose {site_url}{url} for an absolute canonical URL.",
|
|
2711
|
+
example: '<link rel="canonical" href="{site_url}{url}" />'
|
|
2701
2712
|
}
|
|
2702
2713
|
]
|
|
2703
2714
|
};
|
package/dist/editor-api.js
CHANGED
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
serveEditorAsset,
|
|
22
22
|
templateSnapshotIntegrityDiagnostic,
|
|
23
23
|
templateSuffixConflictDiagnostic
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-K6WMGWIF.js";
|
|
25
|
+
import "./chunk-GWK7KV2Z.js";
|
|
26
26
|
export {
|
|
27
27
|
FileBrandingStore,
|
|
28
28
|
InMemoryBrandingStore,
|
package/dist/index.js
CHANGED
package/dist/mcp.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
MCP_TOOLS,
|
|
4
4
|
callMcpTool,
|
|
5
5
|
readMcpResource
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-K6WMGWIF.js";
|
|
7
|
+
import "./chunk-GWK7KV2Z.js";
|
|
8
8
|
|
|
9
9
|
// ../../hosts/host-mcp/src/http.ts
|
|
10
10
|
import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
@@ -56,7 +56,7 @@ function createMcpServer(deps, identity) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// ../../hosts/host-mcp/src/http.ts
|
|
59
|
-
var DEFAULT_VERSION = true ? "0.1.
|
|
59
|
+
var DEFAULT_VERSION = true ? "0.1.35" : "0.0.0-workspace";
|
|
60
60
|
async function handleMcpRequest(deps, request, opts) {
|
|
61
61
|
const server = createMcpServer(deps, {
|
|
62
62
|
name: opts?.name ?? "nanoesis",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ai as Ke,aG as F,ag as Te,aa as g,W as w,T as e,h as n,ab as Qe,q as a,Q as z,aH as h,y as j,aC as o,R as _,au as v,r as Ve,J as U,x as Ye,i as ze,aN as Ue,aA as c,aI as J,aw as X,ax as _e,Y as Xe,at as Ze,ac as ea}from"./index-
|
|
1
|
+
import{ai as Ke,aG as F,ag as Te,aa as g,W as w,T as e,h as n,ab as Qe,q as a,Q as z,aH as h,y as j,aC as o,R as _,au as v,r as Ve,J as U,x as Ye,i as ze,aN as Ue,aA as c,aI as J,aw as X,ax as _e,Y as Xe,at as Ze,ac as ea}from"./index-DcIPxwAD.js";var aa=_('<p class="placeholder svelte-1lpfi31">Loading preview…</p>'),ta=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),la=_("<option> </option>"),sa=_('<select class="svelte-1lpfi31"></select>'),ra=_('<li class="orphan svelte-1lpfi31"><div class="orphan-head svelte-1lpfi31"><code class="orphan-name svelte-1lpfi31"> </code> <span class="orphan-value svelte-1lpfi31"> </span></div> <div class="orphan-actions svelte-1lpfi31" role="radiogroup"><label class="svelte-1lpfi31"><input type="radio" value="drop"/> Drop</label> <label class="svelte-1lpfi31"><input type="radio" value="keep"/> Keep (unrendered)</label> <label class="svelte-1lpfi31"><input type="radio" value="rename"/> Rename to</label> <!></div></li>'),ia=_(`<section class="resolutions svelte-1lpfi31" aria-label="Orphan field resolutions"><h3 class="svelte-1lpfi31">Orphan fields</h3> <p class="hint svelte-1lpfi31">These fields exist in this item's JSON but the current template doesn't render them.
|
|
2
2
|
Pick what to do with each.</p> <ul class="orphans svelte-1lpfi31"></ul></section>`),na=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),oa=_('<div class="diff svelte-1lpfi31"><section class="pane svelte-1lpfi31" aria-label="Previous version (left)"><header class="pane-head svelte-1lpfi31"><!></header> <pre class="source svelte-1lpfi31"> </pre></section> <section class="pane svelte-1lpfi31" aria-label="Current template (right)"><header class="pane-head svelte-1lpfi31"> </header> <pre class="source svelte-1lpfi31"> </pre></section></div> <!> <!> <div class="commit-bar svelte-1lpfi31"><button type="button" class="primary svelte-1lpfi31"> </button></div>',1),va=_('<header class="detail-head svelte-1lpfi31"><button type="button" class="back svelte-1lpfi31">← Back</button> <h2 class="svelte-1lpfi31"> </h2></header> <!>',1),pa=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),ca=_('<p class="placeholder svelte-1lpfi31">Loading…</p>'),fa=_(`<div class="empty svelte-1lpfi31"><h3 class="svelte-1lpfi31">All caught up</h3> <p>Every content item's fields match its bound template. Migrations show up here when a
|
|
3
3
|
destructive template edit (or a manual hand-edit) leaves an item with orphan fields.</p></div>`),ua=_('<li class="item"><button class="item-row svelte-1lpfi31" type="button"><span class="item-path svelte-1lpfi31"><code> </code></span> <span class="item-summary svelte-1lpfi31"><!> <!> <!></span> <span class="open-icon svelte-1lpfi31">→</span></button></li>'),da=_('<section class="group svelte-1lpfi31"><h3 class="group-title svelte-1lpfi31"><code class="svelte-1lpfi31"> </code> <span class="count svelte-1lpfi31"> </span></h3> <ul class="items svelte-1lpfi31"></ul></section>'),ma=_('<header class="list-head svelte-1lpfi31"><h2>Migrations</h2> <button type="button" class="svelte-1lpfi31"> </button></header> <!>',1),_a=_('<div class="migrations svelte-1lpfi31"><!> <!></div>');function ga(Re,Le){Ke(Le,!0);let M=F(null),u=F(null),Z=F(!1),C=F(null),r=F(Te({})),he=F(Te({})),N=F(!1),W=F(null);g.ensureLoaded();async function Ce(s){v(M,s,!0),v(r,{},!0),v(he,{},!0),v(u,null),v(C,null),v(Z,!0);try{v(u,await ea(s),!0);const f={};for(const l of e(u).orphans){const d=Ee(l.name,e(u).currentTemplateFields);f[l.name]=d?{rename:d}:"keep"}v(r,f,!0)}catch(f){v(C,f instanceof Error?f.message:String(f),!0)}finally{v(Z,!1)}}function ge(){v(M,null),v(u,null),v(C,null)}function Ee(s,f){const l=s.toLowerCase();for(const d of f)if(d.toLowerCase().startsWith(l)||d.toLowerCase().endsWith(l))return d;return null}async function Se(){if(!(e(M)===null||e(u)===null)){v(N,!0),v(W,null);try{const s={drop:Object.entries(e(r)).filter(([,l])=>l==="drop").map(([l])=>l),keep:Object.entries(e(r)).filter(([,l])=>l==="keep").map(([l])=>l),rename:Object.fromEntries(Object.entries(e(r)).filter(([,l])=>typeof l=="object"&&l!==null&&"rename"in l).map(([l,d])=>[l,d.rename])),fill:{...e(he)}},f=await ze(e(M),s);g.refresh().catch(()=>{}),ge()}catch(s){v(W,s instanceof Error?s.message:String(s),!0)}finally{v(N,!1)}}}function Pe(s){return typeof s=="string"?s:JSON.stringify(s)}const qe=Ue(()=>g.list===null?[]:Object.entries(g.list.byTemplate).map(([s,f])=>({template:s,items:[...f].sort((l,d)=>l.path.localeCompare(d.path))})));var be=_a(),xe=a(be);{var Ae=s=>{var f=va(),l=z(f),d=a(l),ee=o(d,2),ae=a(ee),te=o(l,2);{var le=i=>{var m=aa();n(i,m)},se=i=>{var m=ta(),k=a(m);h(()=>c(k,e(C))),n(i,m)},re=i=>{var m=oa(),k=z(m),R=a(k),O=a(R),I=a(O);{var $=p=>{var x=J();h(()=>c(x,`Before — ${e(u).left.template??""}`)),n(p,x)},D=p=>{var x=J("Before — no snapshot available");n(p,x)};w(I,p=>{e(u).left?p($):p(D,-1)})}var ie=o(O,2),ne=a(ie),oe=o(R,2),G=a(oe),E=a(G),b=o(G,2),H=a(b),S=o(k,2);{var K=p=>{var x=ia(),P=o(a(x),4);U(P,21,()=>e(u).orphans,q=>q.name,(q,t)=>{var y=ra(),V=a(y),ye=a(V),We=a(ye),Ie=o(ye,2),$e=a(Ie),we=o(V,2),ke=a(we),fe=a(ke),Fe=o(ke,2),ue=a(Fe),je=o(Fe,2),de=a(je),De=o(je,2);{var Ge=A=>{var T=sa();U(T,20,()=>e(u).currentTemplateFields,B=>B,(B,me)=>{var Y=la(),He=a(Y),Oe={};h(()=>{c(He,me),Oe!==(Oe=me)&&(Y.value=(Y.__value=me)??"")}),n(B,Y)});var Me;Xe(T),h(()=>{Me!==(Me=e(r)[e(t).name].rename)&&(T.value=(T.__value=e(r)[e(t).name].rename)??"",Ze(T,e(r)[e(t).name].rename))}),j("change",T,B=>v(r,{...e(r),[e(t).name]:{rename:B.currentTarget.value}},!0)),n(A,T)};w(De,A=>{typeof e(r)[e(t).name]=="object"&&e(r)[e(t).name]!==null&&"rename"in e(r)[e(t).name]&&A(Ge)})}h(A=>{c(We,e(t).name),c($e,A),X(we,"aria-label",`Resolution for ${e(t).name}`),X(fe,"name",`d-${e(t).name}`),_e(fe,e(r)[e(t).name]==="drop"),X(ue,"name",`d-${e(t).name}`),_e(ue,e(r)[e(t).name]==="keep"),X(de,"name",`d-${e(t).name}`),_e(de,typeof e(r)[e(t).name]=="object"&&e(r)[e(t).name]!==null&&"rename"in e(r)[e(t).name])},[()=>Pe(e(t).value)]),j("change",fe,()=>v(r,{...e(r),[e(t).name]:"drop"},!0)),j("change",ue,()=>v(r,{...e(r),[e(t).name]:"keep"},!0)),j("change",de,()=>v(r,{...e(r),[e(t).name]:{rename:e(u).currentTemplateFields[0]??""}},!0)),n(q,y)}),n(p,x)};w(S,p=>{e(u).orphans.length>0&&p(K)})}var Q=o(S,2);{var ve=p=>{var x=na(),P=a(x);h(()=>c(P,e(W))),n(p,x)};w(Q,p=>{e(W)&&p(ve)})}var pe=o(Q,2),L=a(pe),ce=a(L);h(()=>{var p;c(ne,((p=e(u).left)==null?void 0:p.html)??"(no snapshot covers this item)"),c(E,`After — ${e(u).right.template??""}`),c(H,e(u).right.html),L.disabled=e(N)||e(u).orphans.length===0,c(ce,e(N)?"Migrating…":"Migrate item")}),j("click",L,Se),n(i,m)};w(te,i=>{e(Z)?i(le):e(C)?i(se,1):e(u)&&i(re,2)})}h(()=>c(ae,e(M))),j("click",d,ge),n(s,f)},Be=s=>{var f=ma(),l=z(f),d=o(a(l),2),ee=a(d),ae=o(l,2);{var te=i=>{var m=pa(),k=a(m);h(()=>c(k,g.error)),n(i,m)},le=i=>{var m=ca();n(i,m)},se=i=>{var m=fa();n(i,m)},re=i=>{var m=Ve(),k=z(m);U(k,17,()=>e(qe),R=>R.template,(R,O)=>{var I=da(),$=a(I),D=a($),ie=a(D),ne=o(D,2),oe=a(ne),G=o($,2);U(G,21,()=>e(O).items,E=>E.path,(E,b)=>{var H=ua(),S=a(H),K=a(S),Q=a(K),ve=a(Q),pe=o(K,2),L=a(pe);{var ce=t=>{var y=J();h(V=>c(y,`${e(b).orphanFields.length??""} orphan field${e(b).orphanFields.length===1?"":"s"}:
|
|
4
4
|
${V??""}`),[()=>e(b).orphanFields.join(", ")]),n(t,y)};w(L,t=>{e(b).orphanFields.length>0&&t(ce)})}var p=o(L,2);{var x=t=>{var y=J();h(()=>c(y,`· ${e(b).missingRequiredFields.length??""} missing required`)),n(t,y)};w(p,t=>{e(b).missingRequiredFields.length>0&&t(x)})}var P=o(p,2);{var q=t=>{var y=J();h(()=>c(y,`· best-fit: ${e(b).bestFitSnapshot??""}`)),n(t,y)};w(P,t=>{e(b).bestFitSnapshot&&t(q)})}h(()=>c(ve,e(b).path)),j("click",S,()=>Ce(e(b).path)),n(E,H)}),h(()=>{c(ie,e(O).template),c(oe,`${e(O).items.length??""} item${e(O).items.length===1?"":"s"}`)}),n(R,I)}),n(i,m)};w(ae,i=>{g.error?i(te):g.loading&&g.list===null?i(le,1):g.count===0?i(se,2):i(re,-1)})}h(()=>{d.disabled=g.loading,c(ee,g.loading?"Refreshing…":"Refresh")}),j("click",d,()=>g.refresh()),n(s,f)};w(xe,s=>{e(M)!==null?s(Ae):s(Be,-1)})}var Je=o(xe,2);{var Ne=s=>{};w(Je,s=>{!e(M)&&g.list===null&&s(Ne)})}n(Re,be),Qe()}Ye(["click","change"]);export{ga as default};
|