dimcode-darwin-arm64 0.2.28 → 0.2.29-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
|
|
Binary file
|
|
@@ -70,7 +70,7 @@ OCR returns page text, coordinates, and confidence, and writes the full structur
|
|
|
70
70
|
|
|
71
71
|
4. Always use `--json`. Read output paths, provider/model ids, and errors from JSON instead of scraping human text.
|
|
72
72
|
|
|
73
|
-
5. After success, respond with
|
|
73
|
+
5. After success, respond with every output in a format the user's client can render. For media generation and transcription commands, read `outputs[].path` from the JSON result. `outputs` is required and must contain at least one item for those commands; a missing or empty array is a command-contract failure. Resolve any relative path against `cwd` before rendering it. Then:
|
|
74
74
|
|
|
75
75
|
| Output type | Response format | Example |
|
|
76
76
|
|---|---|---|
|
|
@@ -79,7 +79,9 @@ OCR returns page text, coordinates, and confidence, and writes the full structur
|
|
|
79
79
|
| Video | Markdown link with absolute path | `[video.mp4](/home/user/project/artifacts/video.mp4)` |
|
|
80
80
|
| Other (3D, motion, transcript) | Markdown link with absolute path | `[robot.glb](/home/user/project/artifacts/robot.glb)` |
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
`dim ocr recognize` uses its dedicated success contract instead of `outputs`: require `ok: true` and a non-empty absolute `resultPath`. Return `text` or `textPreview` to the user, link `resultPath` as the complete structured result, and also link optional `textPath` and `pagesPreview[].imagePath` values. Missing `outputs` is valid for OCR. Treat a missing `resultPath` as a command-contract failure.
|
|
83
|
+
|
|
84
|
+
The absolute path is required — relative paths like `./artifacts/image.png` will not render in Desktop. Wrap Markdown destinations in angle brackets so paths containing spaces remain valid, for example ``.
|
|
83
85
|
|
|
84
86
|
## Operating Rules
|
|
85
87
|
|
|
@@ -88,7 +90,10 @@ The absolute path is required — relative paths like `./artifacts/image.png` wi
|
|
|
88
90
|
- If a default is missing, tell the user to configure that capability in Settings / Agent Defaults.
|
|
89
91
|
- `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.
|
|
90
92
|
- Put provider-specific parameters in a JSON object file and pass it with `--options <path>`.
|
|
91
|
-
-
|
|
93
|
+
- When the user requests a video length, always pass it through the CLI `--duration <seconds>` flag. Duration text inside the prompt does not set the provider duration.
|
|
94
|
+
- Video generation can be slow. Use a generous CLI `--timeout` and set the exec tool's `timeoutMs` to the same value or higher. The exec timeout is independent, defaults to 300000 ms, and accepts at most 3600000 ms. For a longer CLI timeout, start exec with `runInBackground: true` and `timeoutMs: -1`.
|
|
95
|
+
- A video command may move to an exec background task after 30 seconds. Use `wait` for its completion notification; do not run `sleep` or provider polling commands. Then read the notification `outputPath`. That path is the exec log containing the CLI JSON, not the generated video. Parse the log's `outputs[].path` and render those media paths.
|
|
96
|
+
- Never claim completion unless an output file exists.
|
|
92
97
|
- For failed commands, explain `error.code`, `error.message`, and `details` from the JSON output. Do not hide the original provider or CLI error.
|
|
93
98
|
- Keep LLM model selection separate from multimodal defaults. A chat model change does not change modality defaults.
|
|
94
99
|
- Do not expose API keys, credentials, headers, or provider secrets.
|
|
@@ -18,10 +18,10 @@ 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 `
|
|
21
|
+
The JSON result includes `outputs[].path`. Require at least one output, resolve each path to an absolute path, and respond with every output:
|
|
22
22
|
|
|
23
23
|
```
|
|
24
|
-

|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
Edit an image:
|
|
@@ -52,6 +52,14 @@ mkdir -p ./artifacts
|
|
|
52
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
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
+
The requested length must be passed with `--duration`. Writing a duration only
|
|
56
|
+
inside `--prompt` leaves the provider duration unset and may use its default.
|
|
57
|
+
|
|
58
|
+
Run this command through exec with `timeoutMs: 1800000`. If exec returns a
|
|
59
|
+
background task, wait for the completion notification and read its
|
|
60
|
+
`outputPath` to obtain the CLI JSON. The notification path is an exec log; the
|
|
61
|
+
generated video path is the JSON `outputs[].path`.
|
|
62
|
+
|
|
55
63
|
Respond with:
|
|
56
64
|
|
|
57
65
|
```
|