@unieai/rabi-session-log-export 0.2.1-rc.3 → 0.2.2-rc.5
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/README.md +1 -1
- package/lib/client.js +1 -315
- package/lib/index.js +434 -19
- package/lib/types/client/CopyToast.d.ts +21 -0
- package/lib/types/client/Dialog.d.ts +8 -7
- package/lib/types/client/controller.d.ts +7 -3
- package/lib/types/client/copy-controller.d.ts +76 -0
- package/lib/types/client/index.d.ts +3 -2
- package/lib/types/client/locales.d.ts +108 -2
- package/lib/types/index.d.ts +3 -2
- package/lib/types/markdown.d.ts +22 -0
- package/lib/types/routes.d.ts +6 -2
- package/locale/de.json +6 -0
- package/locale/es.json +6 -0
- package/locale/fr.json +6 -0
- package/locale/ja.json +6 -0
- package/locale/pt.json +6 -0
- package/locale/ru.json +6 -0
- package/package.json +14 -10
- package/src/archive.ts +706 -0
- package/src/client/CopyToast.tsx +40 -0
- package/src/client/Dialog.tsx +55 -0
- package/src/client/controller.ts +139 -0
- package/src/client/copy-controller.ts +201 -0
- package/src/client/index.ts +105 -0
- package/src/client/locales.ts +149 -0
- package/src/index.ts +234 -0
- package/src/markdown.ts +367 -0
- package/src/routes.ts +17 -0
- package/lib/types/client/HeaderAction.d.ts +0 -26
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Browser plugin owning
|
|
1
|
+
/** Browser plugin owning ZIP download and Markdown copy state, plus feedback controls. */
|
|
2
2
|
import type { Context as ClientContext } from '@unieai/cordis';
|
|
3
3
|
import { SessionLogDownloadController } from './controller.ts';
|
|
4
4
|
import { type SessionLogDownloadKey } from './locales.ts';
|
|
@@ -15,7 +15,8 @@ declare module '@unieai/rabi-client-ui-slots' {
|
|
|
15
15
|
export type { SessionLogDownloadEntry, SessionLogDownloadState } from './controller.ts';
|
|
16
16
|
export declare const inject: string[];
|
|
17
17
|
/**
|
|
18
|
-
* Provide the download controller and mount its modal
|
|
18
|
+
* Provide the download controller and mount its modal, the Markdown copy
|
|
19
|
+
* controller and its root toast, and the shared Session menu actions.
|
|
19
20
|
* @param ctx - browser context carrying slots and locale services.
|
|
20
21
|
*/
|
|
21
22
|
export declare function apply(ctx: ClientContext): void;
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
export declare const NS = "session-log-download";
|
|
3
3
|
/** Simplified-Chinese Session export strings. */
|
|
4
4
|
export declare const zh: {
|
|
5
|
-
readonly '
|
|
5
|
+
readonly 'menu.copyMarkdown': "复制会话为 Markdown";
|
|
6
6
|
readonly 'menu.download': "下载 Session 日志";
|
|
7
7
|
readonly 'menu.feedback': "反馈";
|
|
8
|
+
readonly 'toast.copied': "Session 已复制为 Markdown";
|
|
9
|
+
readonly 'toast.preparationFailed': "无法读取 Session 进行复制,请重试";
|
|
10
|
+
readonly 'toast.clipboardFailed': "无法写入剪贴板,请检查剪贴板权限后重试";
|
|
11
|
+
readonly 'dialog.session': "Session:{sessionId}";
|
|
8
12
|
readonly 'dialog.preparingTitle': "正在导出 Session";
|
|
9
|
-
readonly 'dialog.preparingDescription': "
|
|
13
|
+
readonly 'dialog.preparingDescription': "正在准备包含指定 Session、子 Session 和附件的 ZIP 文件";
|
|
10
14
|
readonly 'dialog.successTitle': "Session 导出已开始下载";
|
|
11
15
|
readonly 'dialog.successDescription': "浏览器正在下载 Session ZIP 文件。";
|
|
12
16
|
readonly 'dialog.errorTitle': "Session 导出失败";
|
|
@@ -17,4 +21,106 @@ export declare const zh: {
|
|
|
17
21
|
export declare const en: Record<keyof typeof zh, string>;
|
|
18
22
|
/** Stable locale keys consumed by the shared modal. */
|
|
19
23
|
export type SessionLogDownloadKey = keyof typeof zh;
|
|
24
|
+
/** Japanese copy, checked against the English keys. */
|
|
25
|
+
export declare const ja: {
|
|
26
|
+
'menu.copyMarkdown': string;
|
|
27
|
+
'menu.download': string;
|
|
28
|
+
'menu.feedback': string;
|
|
29
|
+
'toast.copied': string;
|
|
30
|
+
'toast.preparationFailed': string;
|
|
31
|
+
'toast.clipboardFailed': string;
|
|
32
|
+
'dialog.session': string;
|
|
33
|
+
'dialog.preparingTitle': string;
|
|
34
|
+
'dialog.preparingDescription': string;
|
|
35
|
+
'dialog.successTitle': string;
|
|
36
|
+
'dialog.successDescription': string;
|
|
37
|
+
'dialog.errorTitle': string;
|
|
38
|
+
'dialog.close': string;
|
|
39
|
+
'dialog.commandFailed': string;
|
|
40
|
+
};
|
|
41
|
+
/** Spanish dictionary, checked against the English keys. */
|
|
42
|
+
export declare const es: {
|
|
43
|
+
'menu.copyMarkdown': string;
|
|
44
|
+
'menu.download': string;
|
|
45
|
+
'menu.feedback': string;
|
|
46
|
+
'toast.copied': string;
|
|
47
|
+
'toast.preparationFailed': string;
|
|
48
|
+
'toast.clipboardFailed': string;
|
|
49
|
+
'dialog.session': string;
|
|
50
|
+
'dialog.preparingTitle': string;
|
|
51
|
+
'dialog.preparingDescription': string;
|
|
52
|
+
'dialog.successTitle': string;
|
|
53
|
+
'dialog.successDescription': string;
|
|
54
|
+
'dialog.errorTitle': string;
|
|
55
|
+
'dialog.close': string;
|
|
56
|
+
'dialog.commandFailed': string;
|
|
57
|
+
};
|
|
58
|
+
/** French dictionary, checked against the English keys. */
|
|
59
|
+
export declare const fr: {
|
|
60
|
+
'menu.copyMarkdown': string;
|
|
61
|
+
'menu.download': string;
|
|
62
|
+
'menu.feedback': string;
|
|
63
|
+
'toast.copied': string;
|
|
64
|
+
'toast.preparationFailed': string;
|
|
65
|
+
'toast.clipboardFailed': string;
|
|
66
|
+
'dialog.session': string;
|
|
67
|
+
'dialog.preparingTitle': string;
|
|
68
|
+
'dialog.preparingDescription': string;
|
|
69
|
+
'dialog.successTitle': string;
|
|
70
|
+
'dialog.successDescription': string;
|
|
71
|
+
'dialog.errorTitle': string;
|
|
72
|
+
'dialog.close': string;
|
|
73
|
+
'dialog.commandFailed': string;
|
|
74
|
+
};
|
|
75
|
+
/** German dictionary, checked against the English keys. */
|
|
76
|
+
export declare const de: {
|
|
77
|
+
'menu.copyMarkdown': string;
|
|
78
|
+
'menu.download': string;
|
|
79
|
+
'menu.feedback': string;
|
|
80
|
+
'toast.copied': string;
|
|
81
|
+
'toast.preparationFailed': string;
|
|
82
|
+
'toast.clipboardFailed': string;
|
|
83
|
+
'dialog.session': string;
|
|
84
|
+
'dialog.preparingTitle': string;
|
|
85
|
+
'dialog.preparingDescription': string;
|
|
86
|
+
'dialog.successTitle': string;
|
|
87
|
+
'dialog.successDescription': string;
|
|
88
|
+
'dialog.errorTitle': string;
|
|
89
|
+
'dialog.close': string;
|
|
90
|
+
'dialog.commandFailed': string;
|
|
91
|
+
};
|
|
92
|
+
/** Russian dictionary, checked against the English keys. */
|
|
93
|
+
export declare const ru: {
|
|
94
|
+
'menu.copyMarkdown': string;
|
|
95
|
+
'menu.download': string;
|
|
96
|
+
'menu.feedback': string;
|
|
97
|
+
'toast.copied': string;
|
|
98
|
+
'toast.preparationFailed': string;
|
|
99
|
+
'toast.clipboardFailed': string;
|
|
100
|
+
'dialog.session': string;
|
|
101
|
+
'dialog.preparingTitle': string;
|
|
102
|
+
'dialog.preparingDescription': string;
|
|
103
|
+
'dialog.successTitle': string;
|
|
104
|
+
'dialog.successDescription': string;
|
|
105
|
+
'dialog.errorTitle': string;
|
|
106
|
+
'dialog.close': string;
|
|
107
|
+
'dialog.commandFailed': string;
|
|
108
|
+
};
|
|
109
|
+
/** Portuguese dictionary, checked against the English keys. */
|
|
110
|
+
export declare const pt: {
|
|
111
|
+
'menu.copyMarkdown': string;
|
|
112
|
+
'menu.download': string;
|
|
113
|
+
'menu.feedback': string;
|
|
114
|
+
'toast.copied': string;
|
|
115
|
+
'toast.preparationFailed': string;
|
|
116
|
+
'toast.clipboardFailed': string;
|
|
117
|
+
'dialog.session': string;
|
|
118
|
+
'dialog.preparingTitle': string;
|
|
119
|
+
'dialog.preparingDescription': string;
|
|
120
|
+
'dialog.successTitle': string;
|
|
121
|
+
'dialog.successDescription': string;
|
|
122
|
+
'dialog.errorTitle': string;
|
|
123
|
+
'dialog.close': string;
|
|
124
|
+
'dialog.commandFailed': string;
|
|
125
|
+
};
|
|
20
126
|
//# sourceMappingURL=locales.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
/** Session
|
|
1
|
+
/** Session export command and Host-owned ZIP download and Markdown copy routes. */
|
|
2
2
|
import type { Context } from '@unieai/cordis';
|
|
3
3
|
import Schema from '@unieai/schemastery';
|
|
4
4
|
import { type SessionLogCompressionLevel } from './archive.ts';
|
|
5
5
|
export { DEFAULT_SESSION_LOG_COMPRESSION_LEVEL, flushLiveSessionLog, readSessionLogText, serializeSessionLog, SESSION_LOG_FILENAME, sessionLogExportDeps, sessionLogZipEntries, sessionLogZipFilename, streamSessionLogZip, } from './archive.ts';
|
|
6
6
|
export type { SessionLogCompressionLevel, SessionLogExportDeps, SessionLogExportReady, SessionLogZipEntry, } from './archive.ts';
|
|
7
|
+
export { formatSessionMarkdown } from './markdown.ts';
|
|
7
8
|
export declare const name = "session-log-download";
|
|
8
9
|
export declare const inject: string[];
|
|
9
10
|
export { SESSION_LOG_EXPORT_PATH } from './routes.ts';
|
|
@@ -15,7 +16,7 @@ export interface Config {
|
|
|
15
16
|
/** Validate Session-log archive configuration. */
|
|
16
17
|
export declare const Config: Schema<Config>;
|
|
17
18
|
/**
|
|
18
|
-
* Register the
|
|
19
|
+
* Register the `/export` command and authenticated ZIP download and Markdown copy routes.
|
|
19
20
|
* @param ctx - Host context carrying the human-command registry.
|
|
20
21
|
* @param config - resolved compression policy.
|
|
21
22
|
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure backend converter for one complete committed Session log. The Session
|
|
3
|
+
* Markdown copy Host route uses it, and the package entry exports it for
|
|
4
|
+
* callers that already hold the logical events. The raw log is authoritative:
|
|
5
|
+
* compaction surface replacements never remove earlier messages, and
|
|
6
|
+
* fork-inherited history appears once. Reasoning, system and developer
|
|
7
|
+
* messages, injected non-human context, request headers, and runtime records
|
|
8
|
+
* are omitted.
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import type { SessionEvent } from '@unieai/rabi-session';
|
|
12
|
+
/**
|
|
13
|
+
* Render one complete committed Session log as Markdown. This is a pure backend
|
|
14
|
+
* utility: it needs no mounted plugin, reads no storage, and does not mutate the
|
|
15
|
+
* supplied events. The latest `session/title` event supplies the heading; the
|
|
16
|
+
* rest of the transcript is derived only from the supplied logical events.
|
|
17
|
+
* @param events - complete committed logical event snapshot in seq order, including any inherited prefix.
|
|
18
|
+
* @param sourcePath - optional backend-resolved path to the selected Session artifact; emitted verbatim in a fenced text block.
|
|
19
|
+
* @returns Markdown ending in exactly one newline; an empty log returns the heading and optional source metadata only.
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatSessionMarkdown(events: readonly SessionEvent[], sourcePath?: string): string;
|
|
22
|
+
//# sourceMappingURL=markdown.d.ts.map
|
package/lib/types/routes.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The absolute
|
|
3
|
-
* document-relative
|
|
2
|
+
* The absolute pathnames the Host registers the export routes under and the
|
|
3
|
+
* document-relative forms the browser addresses; see
|
|
4
4
|
* .agents/notes/implemented/architecture/2026-09-14-web-document-relative-app-routes.md.
|
|
5
5
|
*/
|
|
6
6
|
/** Absolute registration path for the ZIP download route. */
|
|
7
7
|
export declare const SESSION_LOG_EXPORT_PATH = "/api/session.export";
|
|
8
8
|
/** Browser-relative form of {@link SESSION_LOG_EXPORT_PATH}. */
|
|
9
9
|
export declare const SESSION_LOG_EXPORT_ROUTE: string;
|
|
10
|
+
/** Absolute registration path for the Markdown copy route. */
|
|
11
|
+
export declare const SESSION_MARKDOWN_EXPORT_PATH = "/api/session.markdown";
|
|
12
|
+
/** Browser-relative form of {@link SESSION_MARKDOWN_EXPORT_PATH}. */
|
|
13
|
+
export declare const SESSION_MARKDOWN_EXPORT_ROUTE: string;
|
|
10
14
|
//# sourceMappingURL=routes.d.ts.map
|
package/locale/de.json
ADDED
package/locale/es.json
ADDED
package/locale/fr.json
ADDED
package/locale/ja.json
ADDED
package/locale/pt.json
ADDED
package/locale/ru.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unieai/rabi-session-log-export",
|
|
3
|
-
"description": "Web Session-log export
|
|
4
|
-
"version": "0.2.
|
|
3
|
+
"description": "Web Session-log ZIP export and Session Markdown copy",
|
|
4
|
+
"version": "0.2.2-rc.5",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -26,28 +26,32 @@
|
|
|
26
26
|
"lib/index.js",
|
|
27
27
|
"lib/client.js",
|
|
28
28
|
"lib/types/**/*.d.ts",
|
|
29
|
+
"lib/types/**/*.d.ts.map",
|
|
30
|
+
"lib/**/*.js.map",
|
|
31
|
+
"src",
|
|
29
32
|
"README.md"
|
|
30
33
|
],
|
|
31
34
|
"license": "MIT",
|
|
32
35
|
"dependencies": {
|
|
33
|
-
"@unieai/rabi-session-format": "0.2.
|
|
34
|
-
"@unieai/schemastery": "3.
|
|
36
|
+
"@unieai/rabi-session-format": "0.2.2-rc.5",
|
|
37
|
+
"@unieai/schemastery": "3.19.0",
|
|
35
38
|
"fflate": "^0.8.2",
|
|
36
|
-
"@unieai/rabi-brand": "0.2.
|
|
39
|
+
"@unieai/rabi-brand": "0.2.2-rc.5"
|
|
37
40
|
},
|
|
38
41
|
"peerDependencies": {
|
|
39
|
-
"@unieai/cordis": "4.0
|
|
40
|
-
"@unieai/rabi-session": "0.2.
|
|
41
|
-
"@unieai/rabi-session-persistence": "0.2.
|
|
42
|
+
"@unieai/cordis": "4.1.0",
|
|
43
|
+
"@unieai/rabi-session": "0.2.2-rc.5",
|
|
44
|
+
"@unieai/rabi-session-persistence": "0.2.2-rc.5"
|
|
42
45
|
},
|
|
43
46
|
"rabi": {
|
|
44
47
|
"client": {
|
|
45
48
|
"inject": [
|
|
46
49
|
"@unieai/rabi-client-locale",
|
|
47
50
|
"@unieai/rabi-client-ui-commands",
|
|
51
|
+
"@unieai/rabi-client-ui-context-menu",
|
|
48
52
|
"@unieai/rabi-client-ui-conversation",
|
|
49
|
-
"@unieai/rabi-client-ui-
|
|
50
|
-
"@unieai/rabi-client-ui-
|
|
53
|
+
"@unieai/rabi-client-ui-layout",
|
|
54
|
+
"@unieai/rabi-client-ui-renderer"
|
|
51
55
|
],
|
|
52
56
|
"platform": "web"
|
|
53
57
|
}
|