@khanglvm/relay 0.22.0 → 0.22.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/docs/AGENT.md +1 -1
- package/package.json +1 -1
- package/src/cli/args.js +4 -2
- package/src/cli/ask.js +4 -3
- package/src/cli/boards.js +10 -7
- package/src/cli/git.js +5 -3
- package/src/cli/help.js +1 -0
- package/src/cli/io.js +21 -0
- package/src/cli/mcp.js +12 -1
- package/src/file-access.js +117 -0
- package/src/file-preview.js +1 -1
- package/src/mcp/boards.js +4 -3
- package/src/mcp/serve.js +4 -4
- package/src/mcp/store.js +2 -2
- package/src/mcp/tools.js +2 -1
- package/src/server/board.js +18 -13
- package/src/server/files.js +10 -0
- package/src/spec/blocks/a2ui.js +1 -1
- package/src/spec/blocks/chart.js +1 -1
- package/src/spec/blocks/code.js +4 -4
- package/src/spec/blocks/diagram.js +3 -3
- package/src/spec/blocks/git-conflict.js +2 -2
- package/src/spec/blocks/image.js +6 -5
- package/src/spec/blocks/markdown.js +2 -2
- package/src/spec/blocks/pdf.js +4 -10
- package/src/spec/blocks/table.js +5 -4
- package/src/spec/blocks/video.js +4 -10
- package/src/spec/blocks/widgets.js +6 -6
- package/src/spec/normalize.js +18 -11
- package/src/spec/pick.js +4 -4
- package/src/spec/sources.js +19 -24
- package/src/store.js +6 -1
- package/types/file-access.d.ts +62 -0
- package/types/mcp/boards.d.ts +2 -1
- package/types/mcp/serve.d.ts +5 -2
- package/types/mcp/store.d.ts +6 -3
- package/types/mcp/tools.d.ts +2 -0
- package/types/spec/blocks/a2ui.d.ts +1 -1
- package/types/spec/blocks/chart.d.ts +1 -1
- package/types/spec/blocks/code.d.ts +2 -2
- package/types/spec/blocks/diagram.d.ts +3 -3
- package/types/spec/blocks/git-conflict.d.ts +1 -1
- package/types/spec/blocks/image.d.ts +2 -2
- package/types/spec/blocks/markdown.d.ts +1 -1
- package/types/spec/blocks/pdf.d.ts +1 -1
- package/types/spec/blocks/table.d.ts +1 -1
- package/types/spec/blocks/video.d.ts +1 -1
- package/types/spec/blocks/widgets.d.ts +4 -4
- package/types/spec/normalize.d.ts +7 -1
- package/types/spec/pick.d.ts +1 -1
- package/types/spec/sources.d.ts +5 -4
- package/types/store.d.ts +8 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function resolveImageSrc(srcRaw: any,
|
|
2
|
-
export declare function normalizeImageBlock(rawBlock: any, id: any,
|
|
1
|
+
export declare function resolveImageSrc(srcRaw: any, files: any, where: any, field: any): string;
|
|
2
|
+
export declare function normalizeImageBlock(rawBlock: any, id: any, files: any, where: any, hasHeight: any): {
|
|
3
3
|
id: any;
|
|
4
4
|
type: string;
|
|
5
5
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export declare function normalizeKpiBlock(rawBlock: any, id: any,
|
|
1
|
+
export declare function normalizeKpiBlock(rawBlock: any, id: any, files: any, where: any, hasHeight: any): {
|
|
2
2
|
id: any;
|
|
3
3
|
type: string;
|
|
4
4
|
items: any;
|
|
5
5
|
};
|
|
6
|
-
export declare function normalizeTypographyBlock(rawBlock: any, id: any,
|
|
6
|
+
export declare function normalizeTypographyBlock(rawBlock: any, id: any, files: any, where: any, hasHeight: any): {
|
|
7
7
|
id: any;
|
|
8
8
|
type: string;
|
|
9
9
|
specimens: any;
|
|
10
10
|
};
|
|
11
|
-
export declare function normalizeCompareBlock(rawBlock: any, id: any,
|
|
11
|
+
export declare function normalizeCompareBlock(rawBlock: any, id: any, files: any, where: any, hasHeight: any): {
|
|
12
12
|
id: any;
|
|
13
13
|
type: string;
|
|
14
14
|
before: string;
|
|
15
15
|
after: string;
|
|
16
16
|
};
|
|
17
|
-
export declare function normalizePaletteBlock(rawBlock: any, id: any,
|
|
17
|
+
export declare function normalizePaletteBlock(rawBlock: any, id: any, files: any, where: any, hasHeight: any): {
|
|
18
18
|
id: any;
|
|
19
19
|
type: string;
|
|
20
20
|
palettes: any;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @param {Record<string, any>} raw
|
|
3
|
+
* @param {{ cwd?: string, fileRoots?: string[] }} [options] `fileRoots` limits which local files the spec may read
|
|
4
|
+
* (default: `cwd` only); `[]` allows none, for a spec that came from a remote client.
|
|
5
|
+
*/
|
|
6
|
+
export declare function normalizeSpec(raw: Record<string, any>, { cwd, fileRoots }?: {
|
|
2
7
|
cwd?: string;
|
|
8
|
+
fileRoots?: string[];
|
|
3
9
|
}): {
|
|
4
10
|
title: string;
|
|
5
11
|
intro: string;
|
package/types/spec/pick.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param {Record<string, any>} q the question being built
|
|
5
5
|
* @param {Record<string, any>} rq what the agent wrote
|
|
6
6
|
*/
|
|
7
|
-
export declare function normalizePick(q: Record<string, any>, rq: Record<string, any>, where: any,
|
|
7
|
+
export declare function normalizePick(q: Record<string, any>, rq: Record<string, any>, where: any, files: any): void;
|
|
8
8
|
/**
|
|
9
9
|
* The answer to a pick question, cut down to what the question allows: known ids
|
|
10
10
|
* once each, at most `max` of them in the order picked, notes only when the tiles
|
package/types/spec/sources.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export declare const asStr: (v: any) => string;
|
|
2
2
|
export declare function clampInt(v: any, min: any, max: any, def: any): any;
|
|
3
|
-
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
3
|
+
/** Reads `htmlFile` through the file roots; an inline `html` string wins. */
|
|
4
|
+
export declare function readHtml(obj: any, files: any, where: any): any;
|
|
5
|
+
export declare function readBlockHtml(block: any, files: any, where: any): any;
|
|
6
|
+
export declare function readTextSource(block: any, inlineKey: any, fileKey: any, files: any, where: any): any;
|
|
7
|
+
export declare function readAnyTextSource(block: any, inlineKeys: any, fileKeys: any, files: any, where: any, label: any): {
|
|
7
8
|
text: string;
|
|
8
9
|
sourceKey: any;
|
|
9
10
|
file?: undefined;
|
package/types/store.d.ts
CHANGED
|
@@ -5,11 +5,18 @@ export declare function ensureDirs(): void;
|
|
|
5
5
|
export declare function newId(): string;
|
|
6
6
|
export declare const artifactDirPath: (id: any) => string;
|
|
7
7
|
export declare function saveBoardArtifact(id: any, bytes: any, ext?: string): string;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @param {any} spec a normalized spec
|
|
10
|
+
* @param {{ fileRoots?: string[] }} [options] the roots the spec was read under; the live server opens only files inside them
|
|
11
|
+
*/
|
|
12
|
+
export declare function createBoard(spec: any, { fileRoots }?: {
|
|
13
|
+
fileRoots?: string[];
|
|
14
|
+
}): {
|
|
9
15
|
id: string;
|
|
10
16
|
createdAt: string;
|
|
11
17
|
title: any;
|
|
12
18
|
cwd: string;
|
|
19
|
+
fileRoots: string[];
|
|
13
20
|
spec: any;
|
|
14
21
|
draft: any;
|
|
15
22
|
result: any;
|