@indreamai/openclaw-plugin 0.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.
Files changed (31) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -0
  3. package/dist/chunk-ENGUNMFI.js +196 -0
  4. package/dist/index.d.ts +11 -0
  5. package/dist/index.js +781 -0
  6. package/dist/setup-entry.d.ts +11 -0
  7. package/dist/setup-entry.js +20 -0
  8. package/openclaw.plugin.json +98 -0
  9. package/package.json +58 -0
  10. package/skills/indream-editor-json/SKILL.md +157 -0
  11. package/skills/indream-editor-json/references/asset-mapping.md +147 -0
  12. package/skills/indream-editor-json/references/common-items.md +280 -0
  13. package/skills/indream-editor-json/references/editor-state.v1.schema.json +1491 -0
  14. package/skills/indream-editor-json/references/keyframes.md +102 -0
  15. package/skills/indream-editor-json/references/material-libraries.md +97 -0
  16. package/skills/indream-editor-json/references/minimal-editor-state.json +36 -0
  17. package/skills/indream-editor-json/references/motion-effects-and-transitions.md +235 -0
  18. package/skills/indream-editor-json/references/recipes.md +122 -0
  19. package/skills/indream-editor-json/references/structure-and-principles.md +159 -0
  20. package/skills/indream-editor-json/references/template-catalog.md +45 -0
  21. package/skills/indream-editor-json/references/templates/chart-showcase.json +654 -0
  22. package/skills/indream-editor-json/references/templates/gallery-carousel.json +538 -0
  23. package/skills/indream-editor-json/references/templates/hello-world.json +212 -0
  24. package/skills/indream-editor-json/references/templates/illustration-board.json +480 -0
  25. package/skills/indream-editor-json/references/templates/keyframe-motion-lab.json +362 -0
  26. package/skills/indream-editor-json/references/templates/product-intro.json +614 -0
  27. package/skills/indream-editor-json/references/templates/subtitle-promo.json +341 -0
  28. package/skills/indream-editor-json/references/text-and-captions.md +211 -0
  29. package/skills/indream-editor-json/references/validation-repair.md +134 -0
  30. package/skills/indream-render-workflow/SKILL.md +57 -0
  31. package/skills/indream-render-workflow/references/workflow.md +19 -0
@@ -0,0 +1,11 @@
1
+ import * as openclaw_plugin_sdk_plugin_entry from 'openclaw/plugin-sdk/plugin-entry';
2
+
3
+ declare const _default: {
4
+ id: string;
5
+ name: string;
6
+ description: string;
7
+ configSchema: openclaw_plugin_sdk_plugin_entry.OpenClawPluginConfigSchema;
8
+ register: NonNullable<openclaw_plugin_sdk_plugin_entry.OpenClawPluginDefinition["register"]>;
9
+ } & Pick<openclaw_plugin_sdk_plugin_entry.OpenClawPluginDefinition, "kind">;
10
+
11
+ export { _default as default };
@@ -0,0 +1,20 @@
1
+ import {
2
+ PLUGIN_DESCRIPTION,
3
+ PLUGIN_ID,
4
+ PLUGIN_NAME,
5
+ pluginConfigSchema
6
+ } from "./chunk-ENGUNMFI.js";
7
+
8
+ // src/setup-entry.ts
9
+ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
10
+ var setup_entry_default = definePluginEntry({
11
+ id: PLUGIN_ID,
12
+ name: PLUGIN_NAME,
13
+ description: PLUGIN_DESCRIPTION,
14
+ configSchema: pluginConfigSchema,
15
+ register() {
16
+ }
17
+ });
18
+ export {
19
+ setup_entry_default as default
20
+ };
@@ -0,0 +1,98 @@
1
+ {
2
+ "id": "indream",
3
+ "name": "Indream",
4
+ "description": "Indream video editor API tools and skills for OpenClaw",
5
+ "version": "0.1.0",
6
+ "skills": [
7
+ "./skills"
8
+ ],
9
+ "contracts": {
10
+ "tools": [
11
+ "indream_editor_capabilities",
12
+ "indream_editor_validate",
13
+ "indream_projects_list",
14
+ "indream_projects_get",
15
+ "indream_projects_list_assets",
16
+ "indream_assets_get",
17
+ "indream_exports_get",
18
+ "indream_exports_list",
19
+ "indream_exports_wait",
20
+ "indream_projects_create",
21
+ "indream_projects_update",
22
+ "indream_projects_sync",
23
+ "indream_projects_delete",
24
+ "indream_projects_add_asset",
25
+ "indream_projects_remove_asset",
26
+ "indream_assets_upload",
27
+ "indream_assets_delete",
28
+ "indream_exports_create",
29
+ "indream_projects_create_export"
30
+ ]
31
+ },
32
+ "uiHints": {
33
+ "apiKey": {
34
+ "label": "Indream API key",
35
+ "help": "Used for all requests to the Indream Open API.",
36
+ "placeholder": "indream_...",
37
+ "sensitive": true
38
+ },
39
+ "baseURL": {
40
+ "label": "Base URL",
41
+ "placeholder": "https://api.indream.ai"
42
+ },
43
+ "timeoutMs": {
44
+ "label": "Timeout (ms)",
45
+ "advanced": true
46
+ },
47
+ "pollIntervalMs": {
48
+ "label": "Poll interval (ms)",
49
+ "advanced": true
50
+ },
51
+ "uploads": {
52
+ "label": "Upload controls",
53
+ "advanced": true
54
+ }
55
+ },
56
+ "configSchema": {
57
+ "type": "object",
58
+ "additionalProperties": false,
59
+ "properties": {
60
+ "apiKey": {
61
+ "type": "string",
62
+ "minLength": 1
63
+ },
64
+ "baseURL": {
65
+ "type": "string",
66
+ "default": "https://api.indream.ai"
67
+ },
68
+ "timeoutMs": {
69
+ "type": "integer",
70
+ "minimum": 1,
71
+ "default": 60000
72
+ },
73
+ "pollIntervalMs": {
74
+ "type": "integer",
75
+ "minimum": 1,
76
+ "default": 2000
77
+ },
78
+ "uploads": {
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "properties": {
82
+ "allowLocalPaths": {
83
+ "type": "boolean",
84
+ "default": true
85
+ },
86
+ "allowRemoteUrls": {
87
+ "type": "boolean",
88
+ "default": true
89
+ }
90
+ },
91
+ "default": {
92
+ "allowLocalPaths": true,
93
+ "allowRemoteUrls": true
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@indreamai/openclaw-plugin",
3
+ "version": "0.1.0",
4
+ "description": "OpenClaw plugin for Indream video editor API workflows",
5
+ "type": "module",
6
+ "files": [
7
+ "dist",
8
+ "skills",
9
+ "openclaw.plugin.json",
10
+ "README.md"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsup src/index.ts src/setup-entry.ts --format esm --dts --tsconfig tsconfig.build.json",
14
+ "typecheck": "tsc --noEmit -p tsconfig.json",
15
+ "lint": "eslint src tests",
16
+ "test": "vitest run"
17
+ },
18
+ "engines": {
19
+ "node": ">=22"
20
+ },
21
+ "openclaw": {
22
+ "extensions": [
23
+ "./dist/index.js"
24
+ ],
25
+ "setupEntry": "./dist/setup-entry.js",
26
+ "compat": {
27
+ "pluginApi": ">=2026.4.2",
28
+ "minGatewayVersion": "2026.4.2"
29
+ },
30
+ "build": {
31
+ "openclawVersion": "2026.4.2",
32
+ "pluginSdkVersion": "2026.4.2"
33
+ },
34
+ "install": {
35
+ "npmSpec": "@indreamai/openclaw-plugin",
36
+ "localPath": ".",
37
+ "defaultChoice": "npm",
38
+ "minHostVersion": ">=2026.4.2"
39
+ }
40
+ },
41
+ "packageManager": "pnpm@10.26.1",
42
+ "dependencies": {
43
+ "@indreamai/client": "^0.3.0",
44
+ "@sinclair/typebox": "^0.34.49",
45
+ "mime-types": "^3.0.2",
46
+ "openclaw": "^2026.4.2"
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "^25.5.2",
50
+ "@typescript-eslint/eslint-plugin": "^8.58.0",
51
+ "@typescript-eslint/parser": "^8.58.0",
52
+ "eslint": "^10.2.0",
53
+ "eslint-config-prettier": "^10.1.8",
54
+ "tsup": "^8.5.1",
55
+ "typescript": "^6.0.2",
56
+ "vitest": "^4.1.2"
57
+ }
58
+ }
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: indream-editor-json
3
+ description: Plan, build, validate, and repair production-ready Indream editor JSON with complete guidance for media, subtitles, motion, transitions, effects, filters, templates, charts, and schema troubleshooting.
4
+ metadata:
5
+ {
6
+ "openclaw":
7
+ {
8
+ "emoji": "🎬",
9
+ "requires":
10
+ {
11
+ "config": ["plugins.entries.indream.config.apiKey"],
12
+ },
13
+ },
14
+ }
15
+ ---
16
+
17
+ # Indream Editor JSON
18
+
19
+ Use this skill when the user wants to create, repair, explain, or optimize Indream editor JSON.
20
+
21
+ ## Goal
22
+
23
+ Produce editor JSON that is valid for the current Indream schema and capability set, matches the user's creative intent, and is ready for validation and export without guesswork.
24
+
25
+ ## Mandatory workflow
26
+
27
+ 1. Identify the requested deliverable before writing JSON:
28
+ - composition size or output ratio
29
+ - target duration and scene structure
30
+ - available assets, captions, templates, existing draft metadata, and export goals
31
+ 2. Call `indream_editor_capabilities` before choosing any capability-bound value:
32
+ - transition types
33
+ - effect types
34
+ - filter types
35
+ - illustration names
36
+ - caption animation types
37
+ - any capability-controlled value that may vary by runtime
38
+ 3. Start from `references/minimal-editor-state.json`, then build in this order:
39
+ - top-level composition fields
40
+ - `assets`
41
+ - `items`
42
+ - `tracks`
43
+ - `transitions`
44
+ - optional `globalBackground` and `deletedAssets`
45
+ 4. Prefer the structured references in this skill over inventing field names or relying on memory.
46
+ 5. Run `indream_editor_validate` before any export or project sync step that should persist the new draft.
47
+ 6. If validation fails, repair the JSON with `references/validation-repair.md`, then validate again.
48
+ 7. If the validator output is ambiguous or a path is hard to interpret, inspect `references/editor-state.v1.schema.json` directly.
49
+
50
+ ## Planning checklist
51
+
52
+ - Decide whether the timeline is:
53
+ - single-track sequential
54
+ - multi-track layered
55
+ - subtitle-heavy
56
+ - template-driven
57
+ - motion-driven with animated geometry
58
+ - Decide whether the user wants:
59
+ - raster media only
60
+ - video plus music or voice-over
61
+ - subtitles from a caption asset
62
+ - animated text instead of a subtitle asset
63
+ - timed effects or filters
64
+ - clip transitions between adjacent scenes
65
+ - Decide whether `text-template` is actually appropriate.
66
+ Use `text-template` only when the required `templateId`, `templateCategory`, and node structure are known.
67
+ Otherwise prefer plain `text`, `image`, `solid`, `illustration`, or `chart` items.
68
+ - If the input comes from an existing draft, preserve unrelated valid top-level metadata instead of dropping it casually.
69
+
70
+ ## Authoring rules
71
+
72
+ - Keep the top-level required keys stable:
73
+ - `compositionWidth`
74
+ - `compositionHeight`
75
+ - `timebaseTicksPerSecond`
76
+ - `tracks`
77
+ - `assets`
78
+ - `items`
79
+ - `transitions`
80
+ - `timebaseTicksPerSecond` must always be `240000`.
81
+ - Keep IDs stable and readable. Reuse the same IDs across updates instead of regenerating them on every revision.
82
+ - Every `track.items[]` entry must exist in `items`.
83
+ - Every item `assetId` must exist in `assets`.
84
+ - Use the upload result from `indream_assets_upload` directly when possible. The simplest stable pattern is to reuse `editorAssetMapping.assetId` as the editor asset key and as the item `assetId`.
85
+ - All geometry-like number fields must use the animated number track shape:
86
+ - `{ "value": number, "keyframes": [] }` for static values
87
+ - `{ "value": number, "keyframes": [{ "timeTicks": n, "value": number }] }` for animated values
88
+ - Do not omit geometry fields from asset-backed items just because they are audio-like or auxiliary. The schema still requires the base item geometry fields.
89
+ - Use `outputRatio` when it helps express user intent, especially when the user asks for a standard aspect ratio such as `16:9` or `9:16`.
90
+ - Preserve optional existing fields that are already valid unless the user asks to remove them.
91
+ - Do not invent unsupported `effectType`, `filterType`, `transition.type`, `illustrationName`, or caption animation names.
92
+ - Do not invent unknown template node contracts. If a template-driven request lacks a real template contract, say so and fall back to regular items.
93
+ - Prefer practical static defaults over speculative animation. Only add motion, transitions, or subtitle effects that the user asked for or that are clearly implied.
94
+
95
+ ## Feature coverage
96
+
97
+ - Timeline structure, ID strategy, composition sizing, static vs animated number tracks:
98
+ - `references/structure-and-principles.md`
99
+ - Upload mapping, asset catalog, asset-specific required metadata:
100
+ - `references/asset-mapping.md`
101
+ - Material libraries, hand-drawn vector illustrations, and sticker compatibility notes:
102
+ - `references/material-libraries.md`
103
+ - Core item catalog for `image`, `video`, `gif`, `lottie`, `audio`, `solid`, `illustration`, `effect`, `filter`, and `chart`:
104
+ - `references/common-items.md`
105
+ - Text overlays, subtitle assets, `captions`, `text-template`, and subtitle animation strategy:
106
+ - `references/text-and-captions.md`
107
+ - Clip animations, keyframes, transitions, effects, filters, and motion design patterns:
108
+ - `references/motion-effects-and-transitions.md`
109
+ - How to add one keyframe to a single property without rewriting the whole item:
110
+ - `references/keyframes.md`
111
+ - Practical composition recipes for common user requests:
112
+ - `references/recipes.md`
113
+ - Full scene templates and composition blueprints:
114
+ - `references/template-catalog.md`
115
+ - `references/templates/`
116
+ - Validation and repair workflow:
117
+ - `references/validation-repair.md`
118
+ - Minimal valid starting point:
119
+ - `references/minimal-editor-state.json`
120
+ - Full fallback schema for edge-case troubleshooting:
121
+ - `references/editor-state.v1.schema.json`
122
+
123
+ ## Repair loop
124
+
125
+ 1. If `indream_editor_validate` returns `valid: false`, fix the reported `errors[]` one by one.
126
+ 2. Prefer the server error path and code over assumptions.
127
+ 3. When an enum value is invalid, replace it with a capability-supported value instead of deleting unrelated fields.
128
+ 4. When a transition is invalid, check all of the following before changing the type:
129
+ - both clips exist
130
+ - both clips are on the same track
131
+ - `fromClipId` and `toClipId` are adjacent in `track.items[]`
132
+ - the transition `type` is supported
133
+ 5. When an asset-backed item fails, inspect both the item shape and the referenced asset shape.
134
+ 6. When the validator path is not enough, search the full fallback schema for the matching definition name or property path.
135
+ 7. Do not create export tasks until validation returns `valid: true`.
136
+
137
+ ## Missing information rules
138
+
139
+ - Ask for clarification when the user requests a specific template, illustration, supported effect or transition value, or subtitle source that cannot be inferred from the available data.
140
+ - If the user wants a complete draft quickly and a capability-bound value is missing, choose the nearest capability-supported value and state that choice explicitly.
141
+ - If the request conflicts with the schema, prioritize a valid JSON result and explain the compromise.
142
+
143
+ ## Reference files
144
+
145
+ - `references/structure-and-principles.md`
146
+ - `references/minimal-editor-state.json`
147
+ - `references/asset-mapping.md`
148
+ - `references/material-libraries.md`
149
+ - `references/common-items.md`
150
+ - `references/text-and-captions.md`
151
+ - `references/motion-effects-and-transitions.md`
152
+ - `references/keyframes.md`
153
+ - `references/recipes.md`
154
+ - `references/template-catalog.md`
155
+ - `references/templates/`
156
+ - `references/validation-repair.md`
157
+ - `references/editor-state.v1.schema.json`
@@ -0,0 +1,147 @@
1
+ # Asset Mapping
2
+
3
+ Use `indream_assets_upload` when the user provides a local file path or a remote media URL.
4
+ Use `indream_projects_list_assets` when the user already has assets attached to an Indream project.
5
+
6
+ ## Recommended ID strategy
7
+
8
+ The most reliable pattern is to reuse the uploaded `editorAssetMapping.assetId` as:
9
+
10
+ - the key under `assets`
11
+ - the nested `assets[*].id`
12
+ - the item-level `assetId`
13
+
14
+ That avoids accidental mismatches.
15
+
16
+ ## Upload result fields that matter for editor JSON
17
+
18
+ The upload tool returns:
19
+
20
+ - `assetId`
21
+ - `type`
22
+ - `filename`
23
+ - `mimetype`
24
+ - `fileUrl`
25
+ - `fileKey`
26
+ - `width`
27
+ - `height`
28
+ - `duration`
29
+ - `editorAssetMapping.assetId`
30
+ - `editorAssetMapping.remoteUrl`
31
+ - `editorAssetMapping.remoteKey`
32
+
33
+ ## Standard mapping pattern
34
+
35
+ ```json
36
+ {
37
+ "assets": {
38
+ "asset_test": {
39
+ "id": "asset_test",
40
+ "type": "image",
41
+ "filename": "hero.png",
42
+ "size": 1024,
43
+ "remoteUrl": "https://cdn.example.com/uploads/hero.png",
44
+ "remoteKey": "uploads/hero.png",
45
+ "mimeType": "image/png",
46
+ "width": 1280,
47
+ "height": 720
48
+ }
49
+ },
50
+ "items": {
51
+ "item-image-hero": {
52
+ "id": "item-image-hero",
53
+ "type": "image",
54
+ "assetId": "asset_test"
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ ## Asset catalog
61
+
62
+ ### Image asset
63
+
64
+ Required shape:
65
+
66
+ - `type: "image"`
67
+ - `id`
68
+ - `filename`
69
+ - `size`
70
+ - `mimeType`
71
+ - `width`
72
+ - `height`
73
+ - `remoteUrl` and `remoteKey` are usually present for uploaded media
74
+
75
+ ### Video asset
76
+
77
+ Required shape:
78
+
79
+ - `type: "video"`
80
+ - `durationInSeconds`
81
+ - `hasAudioTrack`
82
+ - `width`
83
+ - `height`
84
+
85
+ ### GIF asset
86
+
87
+ Required shape:
88
+
89
+ - `type: "gif"`
90
+ - `durationInSeconds`
91
+ - `width`
92
+ - `height`
93
+ - `loopBehavior: "finite" | "loop"`
94
+
95
+ ### Audio asset
96
+
97
+ Required shape:
98
+
99
+ - `type: "audio"`
100
+ - `durationInSeconds`
101
+
102
+ ### Caption asset
103
+
104
+ Required shape:
105
+
106
+ - `type: "caption"`
107
+ - `timingGranularity: "word" | "line"`
108
+ - `captions`
109
+
110
+ Notes:
111
+
112
+ - Caption records are intentionally flexible in the schema.
113
+ - Preserve caption entries from the source whenever possible instead of rewriting them.
114
+ - Caption assets may have `remoteUrl` and `remoteKey` set to `null`.
115
+
116
+ ### Lottie asset
117
+
118
+ Required shape:
119
+
120
+ - `type: "lottie"`
121
+ - `durationInSeconds`
122
+ - `width`
123
+ - `height`
124
+ - `resourceType: "lottie" | "svg"`
125
+
126
+ Common optional fields:
127
+
128
+ - `resourceJson`
129
+ - `resourceComponentId`
130
+ - `materialConfig`
131
+
132
+ ## Item-to-asset relationships
133
+
134
+ - `image` items require an `image` asset.
135
+ - `video` items require a `video` asset.
136
+ - `gif` items require a `gif` asset.
137
+ - `lottie` items require a `lottie` asset.
138
+ - `audio` items require an `audio` asset.
139
+ - `captions` items require a `caption` asset.
140
+ - `text`, `text-template`, `solid`, `illustration`, `effect`, `filter`, and `chart` items do not require assets unless a template node or design workflow explicitly depends on them.
141
+
142
+ ## Practical rules
143
+
144
+ - When in doubt, keep asset map keys equal to the actual asset ID returned by the upload tool.
145
+ - Do not reference a project asset unless it is actually present in `assets`.
146
+ - Do not guess missing `width`, `height`, or `durationInSeconds`. Use the upload or project asset payload.
147
+ - If a request depends on subtitles, prefer a real `caption` asset plus a `captions` item instead of simulating subtitles with dozens of manually timed text items.