@cyber-dash-tech/revela 0.3.1 → 0.4.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 +227 -9
- package/README.zh-CN.md +188 -8
- package/designs/monet/preview.html +2293 -0
- package/designs/starter/DESIGN.md +778 -0
- package/designs/starter/preview.html +271 -0
- package/designs/summit/DESIGN.md +54 -51
- package/designs/summit/preview.html +2284 -0
- package/lib/commands/designs-new.ts +167 -0
- package/lib/commands/designs-preview.ts +36 -0
- package/lib/commands/help.ts +3 -0
- package/lib/design/designs.ts +176 -3
- package/lib/media/batch-save.ts +146 -0
- package/lib/media/download.ts +68 -0
- package/lib/media/save.ts +273 -0
- package/lib/media/types.ts +54 -0
- package/lib/research/image-leads.ts +175 -0
- package/package.json +5 -1
- package/plugin.ts +45 -0
- package/skill/SKILL.md +7 -1
- package/tools/designs-author.ts +62 -0
- package/tools/media-batch-save.ts +25 -0
- package/tools/media-save.ts +40 -0
- package/tools/research-images-list.ts +34 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { tool } from "@opencode-ai/plugin"
|
|
2
|
+
import { saveMediaAsset } from "../lib/media/save"
|
|
3
|
+
|
|
4
|
+
export default tool({
|
|
5
|
+
description:
|
|
6
|
+
"Save one image asset into the workspace assets/ directory and update a media manifest. " +
|
|
7
|
+
"Supports either a sourceUrl or a sourcePath. Records both success and failure states. " +
|
|
8
|
+
"Use this when a research-found image or an existing local image should become a formal project asset.",
|
|
9
|
+
args: {
|
|
10
|
+
topic: tool.schema.string().describe("Topic slug shared by one presentation, e.g. 'ev-market'."),
|
|
11
|
+
id: tool.schema.string().describe("Stable asset id within the topic, e.g. 'tesla-logo-01'."),
|
|
12
|
+
type: tool.schema.enum(["image"]).describe("Asset type. Stage 1 only supports 'image'."),
|
|
13
|
+
purpose: tool.schema
|
|
14
|
+
.enum(["hero", "illustration", "portrait", "logo", "screenshot"])
|
|
15
|
+
.describe("Image purpose in the deck."),
|
|
16
|
+
brief: tool.schema.string().describe("One-sentence reason this image is needed."),
|
|
17
|
+
status: tool.schema
|
|
18
|
+
.enum(["success", "cannot-download", "invalid-url", "cannot-generate"])
|
|
19
|
+
.describe("'success' saves an image asset; other statuses record a failed attempt in the manifest."),
|
|
20
|
+
intendedSection: tool.schema.string().optional().describe("Optional narrative section such as 'market-overview'."),
|
|
21
|
+
sourcePath: tool.schema
|
|
22
|
+
.string()
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("Optional local image path, relative to the workspace root. Preferred when both sourcePath and sourceUrl are present."),
|
|
25
|
+
sourceUrl: tool.schema
|
|
26
|
+
.string()
|
|
27
|
+
.optional()
|
|
28
|
+
.describe("Optional remote image URL to download when sourcePath is not provided."),
|
|
29
|
+
alt: tool.schema.string().optional().describe("Optional alt text for the image."),
|
|
30
|
+
notes: tool.schema.string().optional().describe("Optional usage notes for future slide generation."),
|
|
31
|
+
failureReason: tool.schema
|
|
32
|
+
.string()
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("Required when status is not 'success'. Briefly explain why the image is unavailable."),
|
|
35
|
+
},
|
|
36
|
+
async execute(args, context) {
|
|
37
|
+
const workspaceDir = context.directory ?? process.cwd()
|
|
38
|
+
return JSON.stringify(await saveMediaAsset(args, workspaceDir), null, 2)
|
|
39
|
+
},
|
|
40
|
+
})
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { tool } from "@opencode-ai/plugin"
|
|
2
|
+
import { listResearchImageLeads } from "../lib/research/image-leads"
|
|
3
|
+
|
|
4
|
+
export default tool({
|
|
5
|
+
description:
|
|
6
|
+
"List structured image leads from researches/{topic}/*.md. " +
|
|
7
|
+
"Parses ## Images sections and returns candidate image records for the primary agent to review.",
|
|
8
|
+
args: {
|
|
9
|
+
topic: tool.schema.string().describe("Topic slug shared by one presentation, e.g. 'ev-market'."),
|
|
10
|
+
uses: tool.schema
|
|
11
|
+
.array(tool.schema.enum(["logo", "portrait", "screenshot", "unknown"]))
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("Optional use filter, e.g. ['logo', 'portrait', 'screenshot']"),
|
|
14
|
+
axis: tool.schema
|
|
15
|
+
.array(tool.schema.string())
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Optional axis filter, e.g. ['tesla-profile', 'market-data']"),
|
|
18
|
+
},
|
|
19
|
+
async execute(args, context) {
|
|
20
|
+
const workspaceDir = context.directory ?? process.cwd()
|
|
21
|
+
const result = listResearchImageLeads(args.topic, workspaceDir, {
|
|
22
|
+
uses: args.uses,
|
|
23
|
+
axis: args.axis,
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
return JSON.stringify({
|
|
27
|
+
ok: true,
|
|
28
|
+
topic: result.topic,
|
|
29
|
+
count: result.items.length,
|
|
30
|
+
items: result.items,
|
|
31
|
+
warnings: result.warnings,
|
|
32
|
+
}, null, 2)
|
|
33
|
+
},
|
|
34
|
+
})
|