@cyber-dash-tech/revela 0.1.16 → 0.2.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/README.md +87 -90
- package/README.zh-CN.md +90 -93
- package/lib/agents/research-prompt.ts +12 -2
- package/lib/commands/help.ts +2 -1
- package/lib/commands/pptx.ts +75 -0
- package/lib/document-materials/extract.ts +373 -0
- package/lib/pptx/export.ts +974 -0
- package/package.json +2 -1
- package/plugin.ts +8 -1
- package/tools/extract-document-materials.ts +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyber-dash-tech/revela",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "OpenCode plugin that turns AI into an HTML slide deck generator",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.ts",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@xmldom/xmldom": "^0.9.9",
|
|
54
|
+
"dom-to-pptx": "^1.1.6",
|
|
54
55
|
"fflate": "^0.8.2",
|
|
55
56
|
"jimp": "^1.6.1",
|
|
56
57
|
"mammoth": "^1.12.0",
|
package/plugin.ts
CHANGED
|
@@ -45,10 +45,12 @@ import {
|
|
|
45
45
|
handleDomainsRemove,
|
|
46
46
|
} from "./lib/commands/domains"
|
|
47
47
|
import { handlePdf } from "./lib/commands/pdf"
|
|
48
|
+
import { handlePptx } from "./lib/commands/pptx"
|
|
48
49
|
import designsTool from "./tools/designs"
|
|
49
50
|
import domainsTool from "./tools/domains"
|
|
50
51
|
import researchSaveTool from "./tools/research-save"
|
|
51
52
|
import workspaceScanTool from "./tools/workspace-scan"
|
|
53
|
+
import extractDocumentMaterialsTool from "./tools/extract-document-materials"
|
|
52
54
|
import qaTool from "./tools/qa"
|
|
53
55
|
import { RESEARCH_PROMPT, RESEARCH_AGENT_SIGNATURE } from "./lib/agents/research-prompt"
|
|
54
56
|
import { runQA, formatReport } from "./lib/qa"
|
|
@@ -215,17 +217,22 @@ const server: Plugin = (async (pluginCtx) => {
|
|
|
215
217
|
await handlePdf(param, send)
|
|
216
218
|
throw new Error("__REVELA_PDF_HANDLED__")
|
|
217
219
|
}
|
|
220
|
+
if (sub === "pptx") {
|
|
221
|
+
await handlePptx(param, send)
|
|
222
|
+
throw new Error("__REVELA_PPTX_HANDLED__")
|
|
223
|
+
}
|
|
218
224
|
|
|
219
225
|
await send(`**Unknown sub-command:** \`${sub}\`\nRun \`/revela\` to see available commands.`)
|
|
220
226
|
throw new Error("__REVELA_UNKNOWN_HANDLED__")
|
|
221
227
|
},
|
|
222
228
|
|
|
223
|
-
// ── LLM tools: designs, domains, research, qa
|
|
229
|
+
// ── LLM tools: designs, domains, research, document materials, qa ─────
|
|
224
230
|
tool: {
|
|
225
231
|
"revela-designs": designsTool,
|
|
226
232
|
"revela-domains": domainsTool,
|
|
227
233
|
"revela-research-save": researchSaveTool,
|
|
228
234
|
"revela-workspace-scan": workspaceScanTool,
|
|
235
|
+
"revela-extract-document-materials": extractDocumentMaterialsTool,
|
|
229
236
|
"revela-qa": qaTool,
|
|
230
237
|
},
|
|
231
238
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { tool } from "@opencode-ai/plugin"
|
|
2
|
+
import { extractDocumentMaterials } from "../lib/document-materials/extract"
|
|
3
|
+
|
|
4
|
+
export default tool({
|
|
5
|
+
description:
|
|
6
|
+
"Extract research materials from a workspace document into a workspace-local cache. " +
|
|
7
|
+
"Supports pptx, docx, and xlsx. Produces a manifest plus extracted text, embedded images, and available slide/sheet mappings. " +
|
|
8
|
+
"Unsupported file types are skipped instead of failing.",
|
|
9
|
+
args: {
|
|
10
|
+
file: tool.schema
|
|
11
|
+
.string()
|
|
12
|
+
.describe("Document path relative to workspace root. Supports pptx, docx, and xlsx; other file types are skipped."),
|
|
13
|
+
},
|
|
14
|
+
async execute(args, context) {
|
|
15
|
+
const workspaceDir = context.directory ?? process.cwd()
|
|
16
|
+
return JSON.stringify(await extractDocumentMaterials(args.file, workspaceDir), null, 2)
|
|
17
|
+
},
|
|
18
|
+
})
|