@agy-daddy/plugin-chat-nav 0.0.0-stage → 1.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 +22 -0
- package/NOTICE +6 -0
- package/README.md +2 -2
- package/agy-plugin.json +59 -0
- package/baseline.json +8 -0
- package/locales/en.json +10 -0
- package/locales/zh-CN.json +10 -0
- package/package.json +30 -4
- package/settings.schema.json +105 -0
- package/src/conversation-export.js +776 -0
- package/src/file-service.js +174 -0
- package/src/node.js +465 -0
- package/src/renderer.js +1817 -0
- package/src/styles.js +426 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Antigravity Context Viewer Contributors
|
|
4
|
+
Copyright (c) 2026 Agy-Daddy Contributors
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Agy-Daddy Chat Navigation Plugin (@agy-daddy/plugin-chat-nav)
|
|
2
|
+
|
|
3
|
+
This project incorporates floating chat navigation, thinking auto-collapse guard,
|
|
4
|
+
inline file editor, and safe link opening logic derived from:
|
|
5
|
+
- iamvicliu/antigravity-suite (baseline commit c349284: ag-enhancer-overlay.js)
|
|
6
|
+
Copyright (c) 2026 Antigravity Context Viewer Contributors (MIT License)
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @agy-daddy/plugin-chat-nav
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Agy-Daddy Layer-2 官方插件:对话右侧悬浮导航、对话关键词/正则全文检索、思考块防折叠守卫、扩展位(`chat.navButtons`)、复制会话 ID、多格式导出(MD/HTML/PDF + 保存对话框/默认路径配置)、内联文件编辑与 Cmd+安全外链。
|
package/agy-plugin.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"id": "agy-daddy.chat-nav",
|
|
4
|
+
"publisher": "agy-daddy",
|
|
5
|
+
"version": "1.1.0",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"displayName": {
|
|
8
|
+
"zh-CN": "对话栏增强",
|
|
9
|
+
"en": "Chat Navigation & Editor"
|
|
10
|
+
},
|
|
11
|
+
"description": {
|
|
12
|
+
"zh-CN": "右侧悬浮对话导航条、对话关键词/正则全文检索、思考块锁定、快捷会话切换、复制会话 ID、多格式对话导出(MD/HTML/PDF)、内联文件编辑与安全外链",
|
|
13
|
+
"en": "Floating chat navigation dock, keyword/regex conversation search, thinking expand guard, conversation switching, copy session ID, multi-format export (MD/HTML/PDF), inline file editor, and safe external links"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"agyDaddy": "^1.0.0",
|
|
17
|
+
"antigravity": ">=2.32.0"
|
|
18
|
+
},
|
|
19
|
+
"main": "./src/node.js",
|
|
20
|
+
"renderer": "./src/renderer.js",
|
|
21
|
+
"world": "isolated",
|
|
22
|
+
"activationEvents": ["onStartup"],
|
|
23
|
+
"requires": {
|
|
24
|
+
"anchors": ["chat.scrollViewport", "chat.messageList", "chat.thinkingTrigger"]
|
|
25
|
+
},
|
|
26
|
+
"provides": {
|
|
27
|
+
"services": {
|
|
28
|
+
"chat-nav": { "version": "1.0.0", "realm": "page-isolated" },
|
|
29
|
+
"chat-nav-node": { "version": "1.0.0", "realm": "node" }
|
|
30
|
+
},
|
|
31
|
+
"events": ["chat:thinking-expanded@1"],
|
|
32
|
+
"states": ["state:chat-nav.search@1"],
|
|
33
|
+
"surfaces": ["chat.navButtons"]
|
|
34
|
+
},
|
|
35
|
+
"permissions": [
|
|
36
|
+
"dom:read",
|
|
37
|
+
"dom:write",
|
|
38
|
+
"rpc:read",
|
|
39
|
+
"bridge:route",
|
|
40
|
+
"process:spawn",
|
|
41
|
+
"fs:brain-read",
|
|
42
|
+
"fs:user-files"
|
|
43
|
+
],
|
|
44
|
+
"contributes": {
|
|
45
|
+
"settings": { "schema": "./settings.schema.json" },
|
|
46
|
+
"commands": [
|
|
47
|
+
{ "id": "chat-nav.scroll-top", "title": { "zh-CN": "滚动到对话顶部", "en": "Scroll to top" } },
|
|
48
|
+
{ "id": "chat-nav.scroll-bottom", "title": { "zh-CN": "滚动到对话底部", "en": "Scroll to bottom" } },
|
|
49
|
+
{ "id": "chat-nav.expand-thinking", "title": { "zh-CN": "展开全部思考块", "en": "Expand thinking blocks" } },
|
|
50
|
+
{ "id": "chat-nav.search", "title": { "zh-CN": "执行对话全文检索", "en": "Search conversation messages" } },
|
|
51
|
+
{ "id": "chat-nav.copy-id", "title": { "zh-CN": "复制当前会话 ID", "en": "Copy current session ID" } },
|
|
52
|
+
{ "id": "chat-nav.export-md", "title": { "zh-CN": "导出当前对话为 Markdown", "en": "Export conversation as Markdown" } },
|
|
53
|
+
{ "id": "chat-nav.export", "title": { "zh-CN": "导出当前对话 (MD/HTML/PDF)", "en": "Export conversation (MD/HTML/PDF)" } },
|
|
54
|
+
{ "id": "chat-nav.export-all", "title": { "zh-CN": "批量导出当前对话为全部所选格式", "en": "Export conversation in all selected formats" } },
|
|
55
|
+
{ "id": "chat-nav.browseExportDir", "title": { "zh-CN": "选择默认导出保存文件夹", "en": "Browse default export directory" } }
|
|
56
|
+
],
|
|
57
|
+
"locales": "./locales"
|
|
58
|
+
}
|
|
59
|
+
}
|
package/baseline.json
ADDED
package/locales/en.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"nav.top": "Top",
|
|
3
|
+
"nav.prev": "Prev",
|
|
4
|
+
"nav.next": "Next",
|
|
5
|
+
"nav.bottom": "Bottom",
|
|
6
|
+
"nav.think": "Expand Thinking",
|
|
7
|
+
"nav.copyId": "Copy Session ID",
|
|
8
|
+
"nav.exportMd": "Export Conversation",
|
|
9
|
+
"search.placeholder": "Search messages (regex supported)..."
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agy-daddy/plugin-chat-nav",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Agy-Daddy floating chat navigation, thinking expand guard, search slot, copy session ID, multi-format export (MD/HTML/PDF), inline file editor, and safe external link plugin",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/agy-daddy/agy-daddy.git",
|
|
9
|
+
"directory": "agy-daddy-plugin-chat-nav"
|
|
10
|
+
},
|
|
11
|
+
"main": "./src/node.js",
|
|
12
|
+
"agyPlugin": "./agy-plugin.json",
|
|
13
|
+
"files": [
|
|
14
|
+
"agy-plugin.json",
|
|
15
|
+
"settings.schema.json",
|
|
16
|
+
"src/",
|
|
17
|
+
"locales/",
|
|
18
|
+
"baseline.json",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE",
|
|
21
|
+
"NOTICE"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"test": "node -e \"const cp=require('node:child_process'),fs=require('node:fs'),p=require('node:path');const files=fs.readdirSync('test').filter(f=>f.endsWith('.test.js')).sort().map(f=>p.join('test',f));process.exit(cp.spawnSync(process.execPath,['--test',...files],{stdio:'inherit',env:{...process.env,AGY_DADDY_TEST_MODE:'1'}}).status??1)\""
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=22.4.0"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": { "zh-CN": "对话栏增强", "en": "Chat Navigation" },
|
|
3
|
+
"fields": [
|
|
4
|
+
{
|
|
5
|
+
"key": "showFloatDock",
|
|
6
|
+
"type": "boolean",
|
|
7
|
+
"default": true,
|
|
8
|
+
"label": { "zh-CN": "右侧悬浮导航条", "en": "Floating navigation dock" },
|
|
9
|
+
"description": { "zh-CN": "在对话视口右侧显示置顶、置底、上/下一轮、思考展开、复制会话 ID 与导出 Markdown 控制栏", "en": "Show top, bottom, turn step, thinking, copy session ID, and Markdown export controls alongside chat" }
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"key": "keepThinkingExpanded",
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"default": false,
|
|
15
|
+
"label": { "zh-CN": "锁定思考块保持展开", "en": "Keep thinking blocks expanded" },
|
|
16
|
+
"description": { "zh-CN": "防止宿主在输出完成后自动折叠已展开的思考过程卡片", "en": "Prevent the host from auto-collapsing thinking blocks after completion" }
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"key": "enableInlineFileEditor",
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"default": true,
|
|
22
|
+
"label": { "zh-CN": "产物文件头内联编辑", "en": "Inline file editor" },
|
|
23
|
+
"description": { "zh-CN": "在对话内联文件卡片标题栏注入即时编辑与 ⌘S 保存按钮", "en": "Inject inline edit and Cmd+S save buttons on conversation file headers" }
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"key": "enableCmdClickLinks",
|
|
27
|
+
"type": "boolean",
|
|
28
|
+
"default": true,
|
|
29
|
+
"label": { "zh-CN": "Cmd/Ctrl+点击安全打开外链", "en": "Cmd/Ctrl+click external links" },
|
|
30
|
+
"description": { "zh-CN": "按住 Cmd 或 Ctrl 点击文件路径或安全链接时直接在默认应用打开", "en": "Open safe external links when clicked with Cmd or Ctrl" }
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"key": "searchRegexMode",
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"default": false,
|
|
36
|
+
"label": { "zh-CN": "全文检索默认启用正则", "en": "Enable regex search by default" },
|
|
37
|
+
"description": { "zh-CN": "打开检索栏时默认以正则表达式匹配当前对话内容", "en": "Default to regular-expression matching when searching conversation messages" }
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"key": "searchCaseSensitive",
|
|
41
|
+
"type": "boolean",
|
|
42
|
+
"default": false,
|
|
43
|
+
"label": { "zh-CN": "全文检索区分大小写", "en": "Case-sensitive search" },
|
|
44
|
+
"description": { "zh-CN": "在全文检索时严格区分英文字母大小写", "en": "Match exact uppercase and lowercase characters during search" }
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"key": "exportSaveBehavior",
|
|
48
|
+
"type": "enum",
|
|
49
|
+
"default": "dialog",
|
|
50
|
+
"group": { "zh-CN": "对话导出", "en": "Conversation Export" },
|
|
51
|
+
"label": { "zh-CN": "默认保存行为", "en": "Default save behavior" },
|
|
52
|
+
"description": { "zh-CN": "选择点击导出后弹出系统保存对话框,或直接保存到默认路径", "en": "Choose whether exporting opens the native save dialog or saves directly to the default directory" },
|
|
53
|
+
"options": [
|
|
54
|
+
{ "value": "dialog", "label": { "zh-CN": "打开保存对话框", "en": "Open save dialog" } },
|
|
55
|
+
{ "value": "direct", "label": { "zh-CN": "直接保存到默认路径", "en": "Save directly to default folder" } }
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"key": "exportSaveDir",
|
|
60
|
+
"type": "string",
|
|
61
|
+
"default": "",
|
|
62
|
+
"group": { "zh-CN": "对话导出", "en": "Conversation Export" },
|
|
63
|
+
"placeholder": "~/Downloads",
|
|
64
|
+
"label": { "zh-CN": "默认保存路径", "en": "Default save folder" },
|
|
65
|
+
"description": { "zh-CN": "作为保存对话框的默认初始目录或直接保存的目标目录;留空则使用 ~/Downloads", "en": "Initial folder for the save dialog or target folder for direct save; defaults to ~/Downloads when blank" },
|
|
66
|
+
"browse": {
|
|
67
|
+
"command": "chat-nav.browseExportDir",
|
|
68
|
+
"label": { "zh-CN": "浏览选择", "en": "Browse" }
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"key": "exportFormats",
|
|
73
|
+
"type": "list",
|
|
74
|
+
"maxItems": 3,
|
|
75
|
+
"default": ["md"],
|
|
76
|
+
"group": { "zh-CN": "对话导出", "en": "Conversation Export" },
|
|
77
|
+
"label": { "zh-CN": "允许导出文件格式", "en": "Allowed export formats" },
|
|
78
|
+
"description": { "zh-CN": "支持 md、html、pdf;仅保留 1 项时点击导出直接保存,保留多项时先弹出格式选择", "en": "Supports md, html, pdf; single selection exports directly, multiple selection prompts format choice first" },
|
|
79
|
+
"itemEditor": {
|
|
80
|
+
"kind": "ordered-preset-list",
|
|
81
|
+
"allowCustom": false,
|
|
82
|
+
"presets": [
|
|
83
|
+
{
|
|
84
|
+
"id": "md",
|
|
85
|
+
"label": { "zh-CN": "Markdown (.md)", "en": "Markdown (.md)" },
|
|
86
|
+
"tag": { "zh-CN": "纯文本", "en": "Plaintext" },
|
|
87
|
+
"description": { "zh-CN": "导出为结构化 Markdown 文档并顺带复制到剪贴板", "en": "Export structured Markdown and copy to clipboard" }
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"id": "html",
|
|
91
|
+
"label": { "zh-CN": "网页 (.html)", "en": "HTML (.html)" },
|
|
92
|
+
"tag": { "zh-CN": "富文本排版", "en": "Styled Web" },
|
|
93
|
+
"description": { "zh-CN": "导出为独立样式 HTML 文档,支持浏览器查看与打印", "en": "Export standalone styled HTML document" }
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "pdf",
|
|
97
|
+
"label": { "zh-CN": "PDF (.pdf)", "en": "PDF (.pdf)" },
|
|
98
|
+
"tag": { "zh-CN": "便携文档", "en": "Portable" },
|
|
99
|
+
"description": { "zh-CN": "导出为可归档分享的 PDF 文档", "en": "Export portable PDF document" }
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|