dimcode-darwin-arm64 0.2.27-beta.0 → 0.2.28-beta.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/bin/dimcode CHANGED
Binary file
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 1,
3
+ "runtimeId": "apple-vision",
4
+ "providerId": "apple-vision-local",
5
+ "modelId": "system-text-recognizer",
6
+ "platform": "darwin",
7
+ "arch": "arm64",
8
+ "helper": "dim-vision-ocr"
9
+ }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: dim-modality
3
- description: Use DimCode multimodal CLI when the user asks the agent to generate or edit images, generate video, synthesize speech, transcribe audio, generate music or sound effects, create 3D assets or motion data, or inspect available multimodal defaults through `dim modality`. This skill teaches when to use the CLI, the main execution path, failure handling, and model-specific notes.
3
+ description: Use DimCode multimodal CLI when the user asks the agent to generate or edit images, generate video, synthesize speech, transcribe audio, generate music or sound effects, create 3D assets or motion data, extract exact text from images or PDFs with OCR, or inspect available multimodal defaults through `dim modality`. This skill teaches when to use the CLI, the main execution path, failure handling, and model-specific notes.
4
4
  ---
5
5
 
6
6
  # Dim Modality
@@ -44,17 +44,49 @@ dim modality list --json
44
44
  | Generate a 3D asset | `asset.generate` | `dim asset generate` |
45
45
  | Generate motion data | `motion.generate` | `dim motion generate` |
46
46
 
47
+ ### Image understanding vs. exact text extraction
48
+
49
+ Two different tools read images and PDFs. Pick by what the user actually wants:
50
+
51
+ | User goal | Tool | Why |
52
+ |---|---|---|
53
+ | Describe, summarize, or explain an image or screenshot | `read` | Semantic understanding, charts, diagrams, layout — the vision model interprets meaning |
54
+ | Answer questions about what an image shows | `read` | Visual reasoning, not character accuracy |
55
+ | Extract the **exact characters** from an image or PDF | `dim ocr recognize` | Precise text, page numbers, coordinates, confidence — OCR is authoritative for verbatim text |
56
+ | Read a scanned document, receipt, invoice, or contract | `dim ocr recognize` | Faithful transcription of the printed words |
57
+ | Copy numbers, codes, IDs, or tables out of an image | `dim ocr recognize` | Character-level accuracy matters |
58
+
59
+ The rule: image understanding and visual reasoning go through `read`; verbatim text extraction from images and PDFs goes through `dim ocr recognize`. They do not substitute for each other. When unsure which the user wants, OCR is the safe default only when exact text is the deliverable; otherwise `read`.
60
+
61
+ ```bash
62
+ # Extract exact text from an image or PDF
63
+ dim ocr recognize ./invoice.png --json
64
+ dim ocr recognize ./contract.pdf --json
65
+ ```
66
+
67
+ OCR returns page text, coordinates, and confidence, and writes the full structured result to a file reported in the JSON output. After OCR, you can still pass page images to `read` if the user wants semantic analysis of a specific page.
68
+
47
69
  3. Write outputs under the current workspace, usually `./artifacts/` unless the user asked for another path.
48
70
 
49
71
  4. Always use `--json`. Read output paths, provider/model ids, and errors from JSON instead of scraping human text.
50
72
 
51
- 5. After success, reference the absolute output path. Images can be shown with Markdown image syntax. Audio and video should be reported as absolute paths until Desktop preview support is richer.
73
+ 5. After success, respond with the output in a format the user's client can render. Read the `outputPath` field from the JSON result and convert it to an absolute path (resolve relative paths against `cwd`). Then:
74
+
75
+ | Output type | Response format | Example |
76
+ |---|---|---|
77
+ | Image | Markdown image with absolute path | `![Generated image](/home/user/project/artifacts/image.png)` |
78
+ | Audio | Markdown link with absolute path | `[speech.mp3](/home/user/project/artifacts/speech.mp3)` |
79
+ | Video | Markdown link with absolute path | `[video.mp4](/home/user/project/artifacts/video.mp4)` |
80
+ | Other (3D, motion, transcript) | Markdown link with absolute path | `[robot.glb](/home/user/project/artifacts/robot.glb)` |
81
+
82
+ The absolute path is required — relative paths like `./artifacts/image.png` will not render in Desktop.
52
83
 
53
84
  ## Operating Rules
54
85
 
55
86
  - If the user did not specify provider/model, use the configured default for that capability.
56
87
  - Only pass `--provider` and `--model` when the user explicitly asks for a temporary override. Overrides do not change defaults.
57
88
  - If a default is missing, tell the user to configure that capability in Settings / Agent Defaults.
89
+ - `ocr.recognize` is a host-owned local capability. Use the provider/model selected by `dim modality get ocr.recognize`; do not silently switch providers after an execution failure. If `dim modality list --json` reports the selected target as unavailable, report that local runtime error to the user.
58
90
  - Put provider-specific parameters in a JSON object file and pass it with `--options <path>`.
59
91
  - Video generation can be slow. Use a generous `--timeout`, and never claim completion unless an output file exists.
60
92
  - For failed commands, explain `error.code`, `error.message`, and `details` from the JSON output. Do not hide the original provider or CLI error.
@@ -75,6 +107,7 @@ Read `references/model-notes.md` when a provider or model may need special handl
75
107
  | Provider disconnected or missing key | Ask the user to check provider connection and API key |
76
108
  | Model disabled | Ask the user to enable the model in the provider model list |
77
109
  | Unsupported capability | Use a model that supports the capability, or ask the user to configure one |
110
+ | OCR runtime unavailable (`local_runtime_unavailable`) | Tell the user the bundled OCR engine is missing or corrupt; recommend reinstalling DimCode. Do not attempt a remote or Python fallback |
78
111
  | Output file missing | Do not report success; explain the CLI JSON error and stderr |
79
112
  | Video timeout | Report timeout details and operation id when available |
80
113
 
@@ -83,6 +116,6 @@ Read `references/model-notes.md` when a provider or model may need special handl
83
116
  When reporting back:
84
117
 
85
118
  - Say which capability was used.
86
- - Give the output file path.
119
+ - Include the output as a Markdown image (for images) or Markdown link (for audio/video/other), using the absolute path from the JSON result. See the format table in §Main Path.
87
120
  - If it failed, state the failure point and the next user action.
88
121
  - Keep the response short unless the user asks for detailed debugging.
@@ -18,6 +18,12 @@ mkdir -p ./artifacts
18
18
  dim image generate --prompt "A clean product poster on a white background with soft natural lighting" --out ./artifacts/image.png --json
19
19
  ```
20
20
 
21
+ The JSON result includes `outputPath`. Resolve it to an absolute path and respond with:
22
+
23
+ ```
24
+ ![Generated image](/absolute/path/to/artifacts/image.png)
25
+ ```
26
+
21
27
  Edit an image:
22
28
 
23
29
  ```bash
@@ -46,6 +52,12 @@ mkdir -p ./artifacts
46
52
  dim video generate --prompt "A robot walking slowly through a rainy neon street, cinematic camera movement" --duration 5 --out ./artifacts/video.mp4 --json --timeout 1800000
47
53
  ```
48
54
 
55
+ Respond with:
56
+
57
+ ```
58
+ [video.mp4](/absolute/path/to/artifacts/video.mp4)
59
+ ```
60
+
49
61
  Image-to-video:
50
62
 
51
63
  ```bash
@@ -73,6 +85,12 @@ mkdir -p ./artifacts
73
85
  dim speech synthesize --text "Hello, this is a speech generation test." --out ./artifacts/speech.mp3 --json
74
86
  ```
75
87
 
88
+ Respond with:
89
+
90
+ ```
91
+ [speech.mp3](/absolute/path/to/artifacts/speech.mp3)
92
+ ```
93
+
76
94
  Specify a voice:
77
95
 
78
96
  ```bash
@@ -94,6 +112,12 @@ mkdir -p ./artifacts
94
112
  dim music generate --prompt "Warm lo-fi piano for a podcast intro" --title "warm intro" --out ./artifacts/music.mp3 --json
95
113
  ```
96
114
 
115
+ Respond with:
116
+
117
+ ```
118
+ [music.mp3](/absolute/path/to/artifacts/music.mp3)
119
+ ```
120
+
97
121
  Generate a sound effect:
98
122
 
99
123
  ```bash
@@ -113,6 +137,32 @@ dim asset generate --prompt "low poly robot game asset" --out ./artifacts/robot.
113
137
  dim motion generate --prompt "walk cycle for a friendly robot" --out ./artifacts/walk.fbx --json
114
138
  ```
115
139
 
140
+ Respond with:
141
+
142
+ ```
143
+ [robot.glb](/absolute/path/to/artifacts/robot.glb)
144
+ ```
145
+
146
+ ## OCR (Exact Text From Images And PDFs)
147
+
148
+ `ocr.recognize` runs the selected host-owned OCR provider. It needs no provider connection or API key. Use it when the deliverable is the verbatim printed text, not a description, and do not silently switch OCR providers when execution fails.
149
+
150
+ Image OCR:
151
+
152
+ ```bash
153
+ dim ocr recognize ./invoice.png --json
154
+ ```
155
+
156
+ PDF OCR (each page is rendered and recognized):
157
+
158
+ ```bash
159
+ dim ocr recognize ./contract.pdf --json
160
+ ```
161
+
162
+ The JSON returns a short text preview plus a `resultPath` to the full structured result (per-page text, coordinates, confidence). For long PDFs, read additional pages from `resultPath` with `read`.
163
+
164
+ If `dim modality list --json` shows `ocr.recognize` with `available=false` (`local_runtime_unavailable`), the bundled OCR engine is missing or corrupt for this platform. Tell the user to reinstall; do not retry against a remote provider.
165
+
116
166
  ## Temporary Provider Or Model Override
117
167
 
118
168
  Use this only when the user explicitly asks for a specific provider or model:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dimcode-darwin-arm64",
3
- "version": "0.2.27-beta.0",
3
+ "version": "0.2.28-beta.0",
4
4
  "description": "dimcode binary for macOS ARM64 (Apple Silicon)",
5
5
  "os": [
6
6
  "darwin"
@@ -9,6 +9,7 @@
9
9
  "arm64"
10
10
  ],
11
11
  "files": [
12
- "bin"
12
+ "bin",
13
+ "runtime"
13
14
  ]
14
15
  }