@thierry-gilgen-ict/engawa-core 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/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +182 -0
- package/dist/index.js.map +1 -0
- package/dist/static-adapter.d.ts +20 -0
- package/dist/static-adapter.d.ts.map +1 -0
- package/dist/static-adapter.js +54 -0
- package/dist/static-adapter.js.map +1 -0
- package/package.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Thierry Gilgen ICT
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ENGAWA_VERSION = "0.1.0";
|
|
3
|
+
export declare const IMPLEMENTATION_PROFILE_VERSION = "0.1";
|
|
4
|
+
export declare const MCP_PROTOCOL_BASELINE = "2026-07-28";
|
|
5
|
+
/** Documented absolute safety ceilings for Engawa config (not hidden MCP-specific limits). */
|
|
6
|
+
export declare const MAX_SEARCH_QUERY_LENGTH_CEILING = 500;
|
|
7
|
+
export declare const MAX_SEARCH_RESULTS_CEILING = 50;
|
|
8
|
+
export declare const resourceIdSchema: z.ZodString;
|
|
9
|
+
export declare const engawaConfigSchema: z.ZodObject<{
|
|
10
|
+
site: z.ZodObject<{
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
canonicalUrl: z.ZodString;
|
|
13
|
+
description: z.ZodString;
|
|
14
|
+
language: z.ZodDefault<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
agentInterface: z.ZodObject<{
|
|
17
|
+
enabled: z.ZodBoolean;
|
|
18
|
+
public: z.ZodBoolean;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
content: z.ZodDefault<z.ZodObject<{
|
|
21
|
+
maxResourceBytes: z.ZodDefault<z.ZodNumber>;
|
|
22
|
+
maxSearchResults: z.ZodDefault<z.ZodNumber>;
|
|
23
|
+
maxSearchQueryLength: z.ZodDefault<z.ZodNumber>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
security: z.ZodObject<{
|
|
26
|
+
publicDefault: z.ZodLiteral<"read-only">;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
metadata: z.ZodObject<{
|
|
29
|
+
version: z.ZodString;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export type EngawaConfig = z.infer<typeof engawaConfigSchema>;
|
|
33
|
+
export declare const engawaResourceSchema: z.ZodObject<{
|
|
34
|
+
id: z.ZodString;
|
|
35
|
+
uri: z.ZodString;
|
|
36
|
+
title: z.ZodString;
|
|
37
|
+
description: z.ZodOptional<z.ZodString>;
|
|
38
|
+
mimeType: z.ZodString;
|
|
39
|
+
content: z.ZodString;
|
|
40
|
+
canonicalUrl: z.ZodString;
|
|
41
|
+
lastModified: z.ZodOptional<z.ZodString>;
|
|
42
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export type EngawaResource = z.infer<typeof engawaResourceSchema>;
|
|
45
|
+
export interface ContentAdapter {
|
|
46
|
+
listResources(): Promise<EngawaResource[]>;
|
|
47
|
+
getResource(idOrUri: string): Promise<EngawaResource | undefined>;
|
|
48
|
+
search(query: string): Promise<EngawaResource[]>;
|
|
49
|
+
}
|
|
50
|
+
export interface AgentInterfaceMetadata {
|
|
51
|
+
engawaVersion: string;
|
|
52
|
+
implementationProfile: string;
|
|
53
|
+
mcpProtocolBaseline: string;
|
|
54
|
+
}
|
|
55
|
+
export interface Engawa {
|
|
56
|
+
readonly config: EngawaConfig;
|
|
57
|
+
readonly adapter: ContentAdapter;
|
|
58
|
+
readonly metadata: AgentInterfaceMetadata;
|
|
59
|
+
listResources(): Promise<EngawaResource[]>;
|
|
60
|
+
getResource(idOrUri: string): Promise<EngawaResource | undefined>;
|
|
61
|
+
search(query: string): Promise<EngawaResource[]>;
|
|
62
|
+
}
|
|
63
|
+
export declare function validateResourceId(id: string): string;
|
|
64
|
+
export declare function normalizeCanonicalUrl(url: string): string;
|
|
65
|
+
export declare function getCanonicalPath(canonicalUrl: string): string;
|
|
66
|
+
export declare function buildResourceUri(canonicalUrl: string, id: string): string;
|
|
67
|
+
export declare function validateEngawaConfig(input: unknown): EngawaConfig;
|
|
68
|
+
export declare function validateAdapterResource(raw: unknown, config: EngawaConfig): EngawaResource;
|
|
69
|
+
export declare function createEngawa(configInput: unknown, adapter: ContentAdapter): Engawa;
|
|
70
|
+
export { StaticContentAdapter, type StaticResourceInput } from "./static-adapter.js";
|
|
71
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,UAAU,CAAC;AACtC,eAAO,MAAM,8BAA8B,QAAQ,CAAC;AACpD,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD,8FAA8F;AAC9F,eAAO,MAAM,+BAA+B,MAAM,CAAC;AACnD,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAS7C,eAAO,MAAM,gBAAgB,aAO1B,CAAC;AAEJ,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;iBAiC7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,oBAAoB;;;;;;;;;;iBAU/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,MAAM,WAAW,cAAc;IAC7B,aAAa,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAC3C,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAClE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;IAC1C,aAAa,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAC3C,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAClE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CAClD;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAqBzD;AAED,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAM7D;AAED,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAMzE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAUjE;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,cAAc,CAmB1F;AAqCD,wBAAgB,YAAY,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,CA+BlF;AAED,OAAO,EAAE,oBAAoB,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const ENGAWA_VERSION = "0.1.0";
|
|
3
|
+
export const IMPLEMENTATION_PROFILE_VERSION = "0.1";
|
|
4
|
+
export const MCP_PROTOCOL_BASELINE = "2026-07-28";
|
|
5
|
+
/** Documented absolute safety ceilings for Engawa config (not hidden MCP-specific limits). */
|
|
6
|
+
export const MAX_SEARCH_QUERY_LENGTH_CEILING = 500;
|
|
7
|
+
export const MAX_SEARCH_RESULTS_CEILING = 50;
|
|
8
|
+
const httpAbsoluteUrlSchema = z
|
|
9
|
+
.string()
|
|
10
|
+
.url()
|
|
11
|
+
.refine((url) => url.startsWith("http://") || url.startsWith("https://"), {
|
|
12
|
+
message: "canonicalUrl must be an absolute http(s) URL",
|
|
13
|
+
});
|
|
14
|
+
export const resourceIdSchema = z
|
|
15
|
+
.string()
|
|
16
|
+
.min(1)
|
|
17
|
+
.max(128)
|
|
18
|
+
.regex(/^[a-zA-Z0-9._-]+$/, "Resource id must contain only letters, digits, dots, underscores, and hyphens");
|
|
19
|
+
export const engawaConfigSchema = z.object({
|
|
20
|
+
site: z.object({
|
|
21
|
+
name: z.string().min(1),
|
|
22
|
+
canonicalUrl: httpAbsoluteUrlSchema,
|
|
23
|
+
description: z.string().min(1),
|
|
24
|
+
language: z.string().min(1).default("en"),
|
|
25
|
+
}),
|
|
26
|
+
agentInterface: z.object({
|
|
27
|
+
enabled: z.boolean(),
|
|
28
|
+
public: z.boolean(),
|
|
29
|
+
}),
|
|
30
|
+
content: z
|
|
31
|
+
.object({
|
|
32
|
+
maxResourceBytes: z.number().int().positive().default(65536),
|
|
33
|
+
maxSearchResults: z.number().int().positive().max(MAX_SEARCH_RESULTS_CEILING).default(10),
|
|
34
|
+
maxSearchQueryLength: z
|
|
35
|
+
.number()
|
|
36
|
+
.int()
|
|
37
|
+
.positive()
|
|
38
|
+
.max(MAX_SEARCH_QUERY_LENGTH_CEILING)
|
|
39
|
+
.default(200),
|
|
40
|
+
})
|
|
41
|
+
.default({
|
|
42
|
+
maxResourceBytes: 65536,
|
|
43
|
+
maxSearchResults: 10,
|
|
44
|
+
maxSearchQueryLength: 200,
|
|
45
|
+
}),
|
|
46
|
+
security: z.object({
|
|
47
|
+
publicDefault: z.literal("read-only"),
|
|
48
|
+
}),
|
|
49
|
+
metadata: z.object({
|
|
50
|
+
version: z.string().min(1),
|
|
51
|
+
}),
|
|
52
|
+
});
|
|
53
|
+
export const engawaResourceSchema = z.object({
|
|
54
|
+
id: resourceIdSchema,
|
|
55
|
+
uri: z.string().min(1),
|
|
56
|
+
title: z.string().min(1),
|
|
57
|
+
description: z.string().optional(),
|
|
58
|
+
mimeType: z.string().min(1),
|
|
59
|
+
content: z.string(),
|
|
60
|
+
canonicalUrl: httpAbsoluteUrlSchema,
|
|
61
|
+
lastModified: z.string().datetime().optional(),
|
|
62
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
63
|
+
});
|
|
64
|
+
export function validateResourceId(id) {
|
|
65
|
+
return resourceIdSchema.parse(id);
|
|
66
|
+
}
|
|
67
|
+
export function normalizeCanonicalUrl(url) {
|
|
68
|
+
const parsed = new URL(url);
|
|
69
|
+
if (parsed.username || parsed.password) {
|
|
70
|
+
throw new Error("canonicalUrl must not contain username or password credentials");
|
|
71
|
+
}
|
|
72
|
+
if (parsed.search) {
|
|
73
|
+
throw new Error("canonicalUrl must not contain a query string");
|
|
74
|
+
}
|
|
75
|
+
if (parsed.hash) {
|
|
76
|
+
throw new Error("canonicalUrl must not contain a fragment");
|
|
77
|
+
}
|
|
78
|
+
let path = parsed.pathname;
|
|
79
|
+
if (path.length > 1 && path.endsWith("/")) {
|
|
80
|
+
path = path.slice(0, -1);
|
|
81
|
+
}
|
|
82
|
+
parsed.pathname = path;
|
|
83
|
+
const normalized = parsed.toString().replace(/\/$/, "");
|
|
84
|
+
return normalized || parsed.origin;
|
|
85
|
+
}
|
|
86
|
+
export function getCanonicalPath(canonicalUrl) {
|
|
87
|
+
const pathname = new URL(canonicalUrl).pathname;
|
|
88
|
+
if (pathname === "/" || pathname === "") {
|
|
89
|
+
return "";
|
|
90
|
+
}
|
|
91
|
+
return pathname;
|
|
92
|
+
}
|
|
93
|
+
export function buildResourceUri(canonicalUrl, id) {
|
|
94
|
+
validateResourceId(id);
|
|
95
|
+
const parsed = new URL(canonicalUrl);
|
|
96
|
+
const path = getCanonicalPath(canonicalUrl);
|
|
97
|
+
const encodedId = encodeURIComponent(id);
|
|
98
|
+
return `engawa://${parsed.host}${path}/r/${encodedId}`;
|
|
99
|
+
}
|
|
100
|
+
export function validateEngawaConfig(input) {
|
|
101
|
+
const parsed = engawaConfigSchema.parse(input);
|
|
102
|
+
const canonicalUrl = normalizeCanonicalUrl(parsed.site.canonicalUrl);
|
|
103
|
+
return {
|
|
104
|
+
...parsed,
|
|
105
|
+
site: {
|
|
106
|
+
...parsed.site,
|
|
107
|
+
canonicalUrl,
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export function validateAdapterResource(raw, config) {
|
|
112
|
+
const resource = engawaResourceSchema.parse(raw);
|
|
113
|
+
const siteBase = config.site.canonicalUrl;
|
|
114
|
+
const expectedUri = buildResourceUri(siteBase, resource.id);
|
|
115
|
+
if (resource.uri !== expectedUri) {
|
|
116
|
+
throw new Error(`Resource URI mismatch for id "${resource.id}": expected "${expectedUri}", got "${resource.uri}"`);
|
|
117
|
+
}
|
|
118
|
+
const normalizedPageUrl = normalizeCanonicalUrl(resource.canonicalUrl);
|
|
119
|
+
if (normalizedPageUrl !== siteBase && !normalizedPageUrl.startsWith(`${siteBase}/`)) {
|
|
120
|
+
throw new Error(`Resource canonicalUrl "${resource.canonicalUrl}" is outside site base "${siteBase}"`);
|
|
121
|
+
}
|
|
122
|
+
return { ...resource, canonicalUrl: normalizedPageUrl };
|
|
123
|
+
}
|
|
124
|
+
function enforceContentBounds(resource, maxBytes) {
|
|
125
|
+
const byteLength = Buffer.byteLength(resource.content, "utf8");
|
|
126
|
+
if (byteLength > maxBytes) {
|
|
127
|
+
throw new Error(`Resource "${resource.id}" exceeds maxResourceBytes (${byteLength} > ${maxBytes})`);
|
|
128
|
+
}
|
|
129
|
+
return resource;
|
|
130
|
+
}
|
|
131
|
+
function normalizeSearchQuery(query, maxLength) {
|
|
132
|
+
const trimmed = query.trim();
|
|
133
|
+
if (trimmed.length === 0) {
|
|
134
|
+
throw new Error("Search query must not be empty");
|
|
135
|
+
}
|
|
136
|
+
if (trimmed.length > maxLength) {
|
|
137
|
+
throw new Error(`Search query exceeds max length (${trimmed.length} > ${maxLength})`);
|
|
138
|
+
}
|
|
139
|
+
for (const char of trimmed) {
|
|
140
|
+
const code = char.charCodeAt(0);
|
|
141
|
+
if (code < 32 && code !== 9 && code !== 10 && code !== 13) {
|
|
142
|
+
throw new Error("Search query contains invalid control characters");
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return trimmed;
|
|
146
|
+
}
|
|
147
|
+
function validateAndBoundResource(raw, config, maxBytes) {
|
|
148
|
+
return enforceContentBounds(validateAdapterResource(raw, config), maxBytes);
|
|
149
|
+
}
|
|
150
|
+
export function createEngawa(configInput, adapter) {
|
|
151
|
+
const config = validateEngawaConfig(configInput);
|
|
152
|
+
const maxBytes = config.content.maxResourceBytes;
|
|
153
|
+
const maxResults = config.content.maxSearchResults;
|
|
154
|
+
const maxQueryLength = config.content.maxSearchQueryLength;
|
|
155
|
+
const metadata = {
|
|
156
|
+
engawaVersion: ENGAWA_VERSION,
|
|
157
|
+
implementationProfile: IMPLEMENTATION_PROFILE_VERSION,
|
|
158
|
+
mcpProtocolBaseline: MCP_PROTOCOL_BASELINE,
|
|
159
|
+
};
|
|
160
|
+
return {
|
|
161
|
+
config,
|
|
162
|
+
adapter,
|
|
163
|
+
metadata,
|
|
164
|
+
async listResources() {
|
|
165
|
+
const resources = await adapter.listResources();
|
|
166
|
+
return resources.map((r) => validateAndBoundResource(r, config, maxBytes));
|
|
167
|
+
},
|
|
168
|
+
async getResource(idOrUri) {
|
|
169
|
+
const resource = await adapter.getResource(idOrUri);
|
|
170
|
+
if (!resource)
|
|
171
|
+
return undefined;
|
|
172
|
+
return validateAndBoundResource(resource, config, maxBytes);
|
|
173
|
+
},
|
|
174
|
+
async search(query) {
|
|
175
|
+
const normalized = normalizeSearchQuery(query, maxQueryLength);
|
|
176
|
+
const results = await adapter.search(normalized);
|
|
177
|
+
return results.slice(0, maxResults).map((r) => validateAndBoundResource(r, config, maxBytes));
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
export { StaticContentAdapter } from "./static-adapter.js";
|
|
182
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AACtC,MAAM,CAAC,MAAM,8BAA8B,GAAG,KAAK,CAAC;AACpD,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAElD,8FAA8F;AAC9F,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,CAAC;AACnD,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,MAAM,qBAAqB,GAAG,CAAC;KAC5B,MAAM,EAAE;KACR,GAAG,EAAE;KACL,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;IACxE,OAAO,EAAE,8CAA8C;CACxD,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,GAAG,CAAC;KACR,KAAK,CACJ,mBAAmB,EACnB,+EAA+E,CAChF,CAAC;AAEJ,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACvB,YAAY,EAAE,qBAAqB;QACnC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAA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AG,MAAM,OAAO,CAAC,aAAa,EAAE,CAAC;YAChD,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,wBAAwB,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC7E,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,OAAe;YAC/B,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YACpD,IAAI,CAAC,QAAQ;gBAAE,OAAO,SAAS,CAAC;YAChC,OAAO,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC9D,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,KAAa;YACxB,MAAM,UAAU,GAAG,oBAAoB,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;YAC/D,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YACjD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,wBAAwB,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;QAChG,CAAC;KACF,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,oBAAoB,EAA4B,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type EngawaResource } from "./index.js";
|
|
2
|
+
export interface StaticResourceInput {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
mimeType?: string;
|
|
7
|
+
content: string;
|
|
8
|
+
path?: string;
|
|
9
|
+
lastModified?: string;
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
export declare class StaticContentAdapter {
|
|
13
|
+
private readonly resources;
|
|
14
|
+
private readonly uriIndex;
|
|
15
|
+
constructor(canonicalUrl: string, inputs: StaticResourceInput[]);
|
|
16
|
+
listResources(): Promise<EngawaResource[]>;
|
|
17
|
+
getResource(idOrUri: string): Promise<EngawaResource | undefined>;
|
|
18
|
+
search(query: string): Promise<EngawaResource[]>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=static-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-adapter.d.ts","sourceRoot":"","sources":["../src/static-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAGpB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8B;IACxD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;gBAEnC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE;IA6BzD,aAAa,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAI1C,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAQjE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CAUvD"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { buildResourceUri, normalizeCanonicalUrl, validateResourceId, } from "./index.js";
|
|
2
|
+
export class StaticContentAdapter {
|
|
3
|
+
resources;
|
|
4
|
+
uriIndex;
|
|
5
|
+
constructor(canonicalUrl, inputs) {
|
|
6
|
+
const normalizedBase = normalizeCanonicalUrl(canonicalUrl);
|
|
7
|
+
this.resources = new Map();
|
|
8
|
+
this.uriIndex = new Map();
|
|
9
|
+
for (const input of inputs) {
|
|
10
|
+
const id = validateResourceId(input.id);
|
|
11
|
+
if (this.resources.has(id)) {
|
|
12
|
+
throw new Error(`Duplicate resource id "${id}"`);
|
|
13
|
+
}
|
|
14
|
+
const path = input.path ?? `/${id}.md`;
|
|
15
|
+
const canonical = `${normalizedBase}${path.startsWith("/") ? path : `/${path}`}`;
|
|
16
|
+
const resource = {
|
|
17
|
+
id,
|
|
18
|
+
uri: buildResourceUri(normalizedBase, id),
|
|
19
|
+
title: input.title,
|
|
20
|
+
description: input.description,
|
|
21
|
+
mimeType: input.mimeType ?? "text/markdown",
|
|
22
|
+
content: input.content,
|
|
23
|
+
canonicalUrl: canonical,
|
|
24
|
+
lastModified: input.lastModified,
|
|
25
|
+
metadata: input.metadata,
|
|
26
|
+
};
|
|
27
|
+
this.resources.set(resource.id, resource);
|
|
28
|
+
this.uriIndex.set(resource.uri, resource.id);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async listResources() {
|
|
32
|
+
return Array.from(this.resources.values()).sort((a, b) => a.id.localeCompare(b.id));
|
|
33
|
+
}
|
|
34
|
+
async getResource(idOrUri) {
|
|
35
|
+
const byId = this.resources.get(idOrUri);
|
|
36
|
+
if (byId)
|
|
37
|
+
return byId;
|
|
38
|
+
const id = this.uriIndex.get(idOrUri);
|
|
39
|
+
if (id)
|
|
40
|
+
return this.resources.get(id);
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
async search(query) {
|
|
44
|
+
const lower = query.toLowerCase();
|
|
45
|
+
const matches = Array.from(this.resources.values()).filter((resource) => {
|
|
46
|
+
const haystack = [resource.id, resource.title, resource.description ?? "", resource.content]
|
|
47
|
+
.join(" ")
|
|
48
|
+
.toLowerCase();
|
|
49
|
+
return haystack.includes(lower);
|
|
50
|
+
});
|
|
51
|
+
return matches.sort((a, b) => a.id.localeCompare(b.id));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=static-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-adapter.js","sourceRoot":"","sources":["../src/static-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAEhB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAapB,MAAM,OAAO,oBAAoB;IACd,SAAS,CAA8B;IACvC,QAAQ,CAAsB;IAE/C,YAAY,YAAoB,EAAE,MAA6B;QAC7D,MAAM,cAAc,GAAG,qBAAqB,CAAC,YAAY,CAAC,CAAC;QAC3D,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;QAE1B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,MAAM,EAAE,GAAG,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACxC,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;gBAC3B,MAAM,IAAI,KAAK,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;YACnD,CAAC;YAED,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,IAAI,EAAE,KAAK,CAAC;YACvC,MAAM,SAAS,GAAG,GAAG,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;YACjF,MAAM,QAAQ,GAAmB;gBAC/B,EAAE;gBACF,GAAG,EAAE,gBAAgB,CAAC,cAAc,EAAE,EAAE,CAAC;gBACzC,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,WAAW,EA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AAC,CAAC,QAAQ,EAAE,EAAE;YACtE,MAAM,QAAQ,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,WAAW,IAAI,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC;iBACzF,IAAI,CAAC,GAAG,CAAC;iBACT,WAAW,EAAE,CAAC;YACjB,OAAO,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1D,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@thierry-gilgen-ict/engawa-core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Framework-independent core for Engawa agent-native websites",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/thierry-gilgen-ict/engawa.git",
|
|
9
|
+
"directory": "packages/core"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/thierry-gilgen-ict/engawa/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/thierry-gilgen-ict/engawa#readme",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsc -p tsconfig.json",
|
|
31
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
32
|
+
"test": "vitest run --config ../../vitest.config.ts packages/core"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"zod": "^4.2.0"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
}
|
|
40
|
+
}
|