- Accueil
- Plugins
- Outils et capacités
- dsh-system1
dsh-system1
exoticknight/dsh-system1
Typed System One decision service for DeepSeek Harness plugins, with an agent tool for yes/no checks, classification, and scoring.
Installer
dsh plugin --profile web add github:exoticknight/dsh-system1README
dsh-system1
A typed System One decision service for DeepSeek Harness plugins. Consumer plugins call ctx.system1.decide(), interpret the results, and choose their own actions.
English | 简体中文
| Primitive | Result |
|---|---|
noul | Probability that a proposition is true (probabilityTrue) |
choice | Candidate key and the full probability distribution |
score | Expected zero-based level and the probability distribution |
box | Normalized image coordinates for a located object |
The service provides request and response validation, per-question results, cancellation, timeouts, provider registration, and execution metadata. TypeSafe/Jev and Cloudflare Clef accept shared image attachments; Jev 1.14 also supports box answers and optional extended context. Other backends can implement the public provider contract.
Install from npm
Install the package in a project that uses System One:
npm install dsh-system1
To activate the bundled service and providers in dsh, add the npm package to the profile you run. Replace <profile> with your profile name:
dsh plugin --profile <profile> add dsh-system1
The dsh plugin command requires a profile; installing into one profile does not activate the bundle in other profiles. To use the GitHub repository as the package source, replace dsh-system1 in that command with github:exoticknight/dsh-system1.
The bundled patch mounts the service and built-in providers. Defaults are model jev-latest, provider id typesafe, and an 800 ms timeout per model attempt. Use the plugin settings to choose a default service and model, add fallback models in the order they should be tried, configure connections, and store keys in DSH credentials; environment variables are also supported. Each fallback gets the full timeout budget, so total request time can grow with the chain length. Adjust timeoutMs to fit backend latency, especially for local CPU inference.
Cloudflare uses provider cloudflare with clef, clef-flash, or clef-omni. See provider setup for configuration.
Agent tool
Once installed, the agent can call the system1_decide tool without a consumer plugin. The main model can hand yes/no checks, classification, and scoring to System One and decide the next step from the returned probabilities. The tool uses the default service and model configured above.
The bundle's system1-tool component provides the tool and is enabled by default. Turn the component off on the Plugins page to remove the tool, or set disabled: true on its entry in a headless profile. See the API reference for arguments and results.
Use from a consumer plugin
In your consumer plugin project, install the package with the npm command above. Then declare inject: ['system1'] and import this package's Cordis type augmentation:
import type { Context } from '@deepseek-ai/cordis'
import type {} from 'dsh-system1'
export const inject = ['system1']
export async function apply(ctx: Context) {
const result = await ctx.system1.decide({
state: 'The user asked about a refund.',
questions: {
refund: {
type: 'noul',
instructions: 'Is the user asking about a refund?',
},
topic: {
type: 'choice',
instructions: 'Choose a topic.',
criteria: { billing: 'Billing', technical: 'Technical support' },
},
urgency: {
type: 'score',
instructions: 'Rate urgency.',
criteria: ['Normal', 'Urgent', 'Critical'],
},
},
})
if (result.answers.topic.status === 'ok') {
return result.answers.topic.answer.value // 'billing' | 'technical'
}
return result.answers.topic.error
}
noul returns probabilityTrue; choice returns a candidate key and its full distribution; score returns an expected level and probabilities ordered by criteria; box returns normalized image edges. These are model outputs, so consumer plugins choose their own decision thresholds and actions. Runtime failures are reported per question with status: 'error'; malformed call structures throw System1InputError.
See API and provider development for the full contract and the consumer example. TypeSafe supports jev-latest, jev-preview, jev-1.14.0, and jev-1.13.0; see provider setup for other services and their limits.
Development
Use the Node.js and pnpm versions declared in package.json:
pnpm install --frozen-lockfile
pnpm verify
pnpm test runs the plugin and provider tests with local fixtures, as CI does; pnpm test <plugin|providers|provider name> runs a subset. Live model probes, pnpm probe <typesafe|cloudflare|laya|clef-local>, read credentials from .env.local, and local targets set up their own service on first use; see testing and live model validation.
See the contribution guide and release process.
License
Licensed under the Apache License 2.0.