docs(vision): package READMEs, Model Experience, and the capability Agent Note
Document the four image-recognition packages and the vision group, register the vision domain in the package index, add the capability decision as an Agent Note, declare the invariants peer dep, and drop the unused agents injection from the consumer. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,7 @@ Groups hold `packages/<group>/<pkg>/`; names stay `@deepseek-ai/dsh-<pkg>`. **Gr
|
||||
| [`workflow/`](workflow/README.md) | Workflow seam, worker-thread engine, and model-facing `workflow`/`ralph` tools | Product — stable API |
|
||||
| [`web/`](web/README.md) | Web capability family: seam, search/fetch provider impls, and the model-facing web tools | Product — stable API |
|
||||
| [`attachment/`](attachment/README.md) | Durable attachment identity, validation, local content-addressed storage | Product — stable API |
|
||||
| [`vision/`](vision/README.md) | Image-recognition capability family: seam, configurable HTTP provider, and model-facing recognition tool + skill | Product — stable API |
|
||||
| [`spill/`](spill/README.md) | Spill capability family: storage seam, local impl, tool-result spill policy | Product — stable API |
|
||||
| [`todo/`](todo/README.md) | The model-facing `todo_write` tool | Product — stable API |
|
||||
| [`plan/`](plan/README.md) | Plan collaboration state with a direct entry command and reviewed exit | Product — stable API |
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# @deepseek-ai/dsh-image-recognition-bundle
|
||||
|
||||
Opt-in image-recognition bundle for a profile. Its `cordis.patch.yml` mounts the
|
||||
capability seam (`@deepseek-ai/dsh-image-recognition`), the configurable HTTP
|
||||
provider (`@deepseek-ai/dsh-image-recognition-http`), and the model-facing
|
||||
consumer (`@deepseek-ai/dsh-tool-image-recognition`).
|
||||
|
||||
The bundle is **not** in any default profile's bundles list. Enable it per
|
||||
profile by adding this package to the profile's `dsh.profile.bundles` (or
|
||||
`dsh plugin --profile <name> add @deepseek-ai/dsh-image-recognition-bundle`),
|
||||
then configure the endpoint and key in the Plugins settings page
|
||||
(`image-recognition` card).
|
||||
|
||||
## Known Limitations and Deferred Work
|
||||
|
||||
- Requires the user to supply a vision provider endpoint and key; recognition is
|
||||
unavailable until both are configured.
|
||||
@@ -0,0 +1,17 @@
|
||||
# vision/
|
||||
|
||||
Image-recognition capability family over the DeepSeek Harness: a Service
|
||||
Definition seam, a user-configurable HTTP vision provider, and the model-facing
|
||||
recognition consumer (tool + skill + deterministic image-task injection). The
|
||||
opt-in bundle composes them for a profile.
|
||||
|
||||
| Package | Role |
|
||||
|---|---|
|
||||
| [`image-recognition/`](image-recognition/README.md) | Service Definition: `ctx.imageRecognition` provider registry + selection + `ImageRecognitionError` |
|
||||
| [`image-recognition-http/`](image-recognition-http/README.md) | Provider: user-configured OpenAI-compatible chat-completions vision endpoint |
|
||||
| [`tool-image-recognition/`](tool-image-recognition/README.md) | Consumer: `recognize_image` tool, `image-recognition` skill, deterministic image-task injection |
|
||||
| [`../bundle/image-recognition`](../bundle/image-recognition/README.md) | Opt-in bundle mounting the seam, provider, and consumer |
|
||||
|
||||
A capability seam keeps Service Definition / Provider / Consumer roles separate
|
||||
([capability seams](../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.md));
|
||||
the opt-in bundle is how a deployment turns image recognition on per profile.
|
||||
@@ -0,0 +1,29 @@
|
||||
# @deepseek-ai/dsh-image-recognition-http
|
||||
|
||||
A user-configurable HTTP vision provider for `ctx.imageRecognition`. It calls an
|
||||
OpenAI-compatible `/chat/completions` endpoint with the image encoded as a data
|
||||
URL and returns the recognized text.
|
||||
|
||||
## Config
|
||||
|
||||
| Key | Type | Meaning |
|
||||
|---|---|---|
|
||||
| `baseURL` | string | Endpoint base; `/chat/completions` is appended. Blank inherits `$DSH_IMAGE_RECOGNITION_BASE_URL`, else unavailable. |
|
||||
| `apiKey` | string (secret) | Literal key; prefer `apiKeyEnv`. |
|
||||
| `apiKeyEnv` | string (credential-ref) | Credential reference resolved per recognition; defaults to `DEEPSEEK_API_KEY`. |
|
||||
| `model` | string | Vision model name; defaults to `deepseek-v4-flash`. |
|
||||
| `maxTokens` | number | Generated-token bound; defaults to 2048. |
|
||||
|
||||
The endpoint and key are editable live through the `image-recognition-http`
|
||||
settings section. The key never rides a response: it is resolved per recognition
|
||||
from the credentials domain, falling back to the launch environment.
|
||||
|
||||
A recognition under an initiating Agent appends the log-only
|
||||
`image-recognition/llm-request` session event carrying the secret-free request
|
||||
body before dispatch.
|
||||
|
||||
## Known Limitations and Deferred Work
|
||||
|
||||
- The provider assumes an OpenAI-compatible vision endpoint; non-standard
|
||||
endpoints must be adapted via `baseURL`/`model` (or a new provider).
|
||||
- `file-path` inputs require an inferable media type from the extension.
|
||||
@@ -31,6 +31,9 @@
|
||||
"lib/types/**/*.d.ts"
|
||||
],
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@deepseek-ai/dsh-invariants": "workspace:^"
|
||||
},
|
||||
"dependencies": {
|
||||
"@deepseek-ai/schemastery": "workspace:^"
|
||||
},
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# @deepseek-ai/dsh-image-recognition
|
||||
|
||||
Service Definition for the image-recognition capability seam (`ctx.imageRecognition`):
|
||||
a provider registry and provider-selecting execution, mirrored on the web seam.
|
||||
|
||||
- A provider registers via `ctx.imageRecognition.registerProvider(provider)`; a
|
||||
duplicate `id` throws `IMAGE_RECOGNITION_DUPLICATE_PROVIDER`.
|
||||
- `recognize(request, signal)` resolves the provider at call time. Selection is
|
||||
order-independent: a configured id must be registered and `available()`;
|
||||
without a configured id, exactly one usable provider auto-selects. See the
|
||||
`ImageRecognitionError` codes for missing/unavailable/ambiguous providers.
|
||||
- `ImageInput` is a closed union of `file-path`, `base64`, and `url`; a provider
|
||||
encodes the kind it serves.
|
||||
|
||||
## Config
|
||||
|
||||
`provider` pins which provider wins; `$DSH_IMAGE_RECOGNITION_PROVIDER` is the
|
||||
environment equivalent (not a hidden priority chain).
|
||||
|
||||
## Known Limitations and Deferred Work
|
||||
|
||||
- The seam is provider-neutral by design; image decoding/encoding lives in the
|
||||
provider, not here.
|
||||
- `ImageRecognitionError` codes are open-string and provider-specific codes are
|
||||
tolerated by consumers.
|
||||
@@ -0,0 +1,100 @@
|
||||
# @deepseek-ai/dsh-tool-image-recognition
|
||||
|
||||
Model-facing image-recognition consumer. Registers a bundled `image-recognition`
|
||||
skill and a `recognize_image` tool, and hooks `agent/pre-step` to deterministically
|
||||
inject the skill body when a step input carries an image, so the model recognizes
|
||||
the image before continuing the task.
|
||||
|
||||
## Config
|
||||
|
||||
| Key | Type | Meaning |
|
||||
|---|---|---|
|
||||
| `detectImageBlocks` | boolean | Inject the skill body when a step input carries an image content block (default true). |
|
||||
| `detectImagePaths` | boolean | Inject the skill body when a step input text names an image file path or URL (default true). |
|
||||
|
||||
Detection is a cheap signal (image content block or path/URL in text), never an
|
||||
image-byte read. The injection guarantees the skill instructions are present; the
|
||||
model still drives the actual `recognize_image` call.
|
||||
|
||||
## Model Experience
|
||||
|
||||
### Tool schema
|
||||
|
||||
#### What the model sees
|
||||
|
||||
The model sees the generated [`recognize_image` schema](../../../docs/tool-catalog.md#deepseek-aidsh-tool-image-recognition). The tool takes an `image` (file path, https URL, or data URL) and an optional `prompt` naming what to extract, and returns the recognized text from the configured provider.
|
||||
|
||||
#### Token effect
|
||||
|
||||
Fixed schema cost per request while the tool is visible.
|
||||
|
||||
#### KV Cache effect
|
||||
|
||||
Prefix-stable while the tool definition and visibility are unchanged.
|
||||
|
||||
### Skill body
|
||||
|
||||
#### What the model sees
|
||||
|
||||
The `image-recognition` skill appears in the session skill catalog and loads through the `skill` tool; its body instructs the model to recognize an image with `recognize_image` first and act on the recognized text as ground truth. The rendered body is:
|
||||
|
||||
##### Skill body template
|
||||
|
||||
```markdown
|
||||
<skill_content name="image-recognition">
|
||||
<skill_instructions>
|
||||
When the task involves an image (an attached image, an image file path, or an image URL), FIRST recognize its content before continuing the task:
|
||||
1. Determine which image the task refers to from the conversation (attachment, path, or URL).
|
||||
2. Call `recognize_image` with that image and, when useful, a `prompt` naming what to extract.
|
||||
3. Use the recognized text as ground truth to complete the original task.
|
||||
Do not guess at image contents from a filename or description — run `recognize_image` and act on its result.
|
||||
</skill_instructions>
|
||||
</skill_content>
|
||||
```
|
||||
|
||||
#### Token effect
|
||||
|
||||
The catalog entry costs one line; loading the skill body costs its full text once per load.
|
||||
|
||||
#### KV Cache effect
|
||||
|
||||
Prefix-stable until the skill body loads; the loaded body appends as a new suffix.
|
||||
|
||||
### Image-task injection
|
||||
|
||||
#### What the model sees
|
||||
|
||||
When a step input carries an image (an image content block, or a text block naming an image file path or URL — see Config), the plugin injects the `image-recognition` skill body as a plugin-sourced user message at the front of the step.
|
||||
|
||||
#### Token effect
|
||||
|
||||
One injected user message per image-bearing step while detection is on.
|
||||
|
||||
#### KV Cache effect
|
||||
|
||||
Injected messages append after the reusable prefix, forming a per-step suffix that resets when no image is present.
|
||||
|
||||
### System prompt section
|
||||
|
||||
#### What the model sees
|
||||
|
||||
A `tool:image-recognition` system-prompt section adds the guidance below:
|
||||
|
||||
##### System prompt guidance
|
||||
|
||||
```markdown
|
||||
When a task involves an image, recognize it first with `recognize_image` before continuing; do not infer image contents from a filename or description.
|
||||
```
|
||||
|
||||
#### Token effect
|
||||
|
||||
One fixed system-prompt sentence per request.
|
||||
|
||||
#### KV Cache effect
|
||||
|
||||
Prefix-stable while the guidance text is unchanged.
|
||||
|
||||
## Known Limitations and Deferred Work
|
||||
|
||||
- Path/URL detection is heuristic and can be disabled; misdetections are possible.
|
||||
- Requires a configured, available provider — see `dsh-image-recognition-http`.
|
||||
@@ -31,6 +31,9 @@
|
||||
"lib/types/**/*.d.ts"
|
||||
],
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@deepseek-ai/dsh-invariants": "workspace:^"
|
||||
},
|
||||
"dependencies": {
|
||||
"@deepseek-ai/schemastery": "workspace:^"
|
||||
},
|
||||
|
||||
@@ -17,7 +17,7 @@ import { isModelInvocable, renderSkillContent } from '@deepseek-ai/dsh-skill'
|
||||
import type { ImageInput, ImageRecognitionResult } from '@deepseek-ai/dsh-image-recognition'
|
||||
|
||||
export const name = 'tool-image-recognition'
|
||||
export const inject = ['agents', 'imageRecognition', 'skills', 'systemPrompt', 'tools']
|
||||
export const inject = ['imageRecognition', 'skills', 'systemPrompt', 'tools']
|
||||
|
||||
const SKILL_NAME = 'image-recognition'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user