diff --git a/packages/bundle/image-recognition/cordis.patch.yml b/packages/bundle/image-recognition/cordis.patch.yml new file mode 100644 index 0000000000..8e4b917fa4 --- /dev/null +++ b/packages/bundle/image-recognition/cordis.patch.yml @@ -0,0 +1,25 @@ +# The dsh-image-recognition-bundle patch: an opt-in image-recognition surface +# over dsh-base. It is NOT part of any default profile's bundles list — a user +# opts in by adding this package to the profile's dsh.profile.bundles (or via +# `dsh plugin --profile add @deepseek-ai/dsh-image-recognition-bundle`). +# +# The seam row pins the http provider; the provider row carries the credential +# reference the provider resolves per recognition; the consumer row toggles the +# deterministic image-task injection. + +- insert: + - id: image-recognition + name: '@deepseek-ai/dsh-image-recognition' + config: + provider: http + + - id: image-recognition-http + name: '@deepseek-ai/dsh-image-recognition-http' + config: + apiKeyEnv: DEEPSEEK_API_KEY + + - id: tool-image-recognition + name: '@deepseek-ai/dsh-tool-image-recognition' + config: + detectImageBlocks: true + detectImagePaths: true diff --git a/packages/bundle/image-recognition/package.json b/packages/bundle/image-recognition/package.json new file mode 100644 index 0000000000..7b9d19b8e5 --- /dev/null +++ b/packages/bundle/image-recognition/package.json @@ -0,0 +1,60 @@ +{ + "name": "@deepseek-ai/dsh-image-recognition-bundle", + "description": "Opt-in image-recognition bundle for the DeepSeek Harness: mounts the image-recognition capability seam, a configurable HTTP vision provider, and the model-facing recognition tool + skill with deterministic image-task injection", + "version": "0.1.0-rc.5", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/deepseek-ai/deepseek-harness.git", + "directory": "packages/bundle/image-recognition" + }, + "type": "module", + "main": "lib/index.js", + "types": "lib/types/index.d.ts", + "exports": { + ".": { + "types": "./lib/types/index.d.ts", + "default": "./lib/index.js" + }, + "./invariant": { + "types": "./lib/types/invariant.d.ts", + "default": "./lib/invariant.js" + }, + "./cordis.patch.yml": "./cordis.patch.yml", + "./src/*": "./src/*", + "./package.json": "./package.json" + }, + "files": [ + "lib/index.js", + "lib/invariant.js", + "cordis.patch.yml", + "lib/types/**/*.d.ts" + ], + "license": "MIT", + "dsh": { + "bundle": { + "patch": "./cordis.patch.yml" + } + }, + "dependencies": { + "@deepseek-ai/dsh-image-recognition": "workspace:^", + "@deepseek-ai/dsh-image-recognition-http": "workspace:^", + "@deepseek-ai/dsh-tool-image-recognition": "workspace:^", + "@deepseek-ai/schemastery": "workspace:^" + }, + "peerDependencies": { + "@deepseek-ai/dsh-agent": "workspace:^", + "@deepseek-ai/dsh-invariants": "workspace:^", + "@deepseek-ai/cordis": "workspace:^" + }, + "devDependencies": { + "@deepseek-ai/dsh-agent": "workspace:^", + "@deepseek-ai/dsh-image-recognition": "workspace:^", + "@deepseek-ai/dsh-image-recognition-http": "workspace:^", + "@deepseek-ai/dsh-invariants": "workspace:^", + "@deepseek-ai/dsh-tool-image-recognition": "workspace:^", + "@deepseek-ai/cordis": "workspace:^" + } +} diff --git a/packages/bundle/image-recognition/src/index.ts b/packages/bundle/image-recognition/src/index.ts new file mode 100644 index 0000000000..c12012681e --- /dev/null +++ b/packages/bundle/image-recognition/src/index.ts @@ -0,0 +1,10 @@ +/** + * @deepseek-ai/dsh-image-recognition-bundle — opt-in image-recognition surface. + * The bundle patch mounts the image-recognition capability seam, a configurable + * HTTP vision provider, and the model-facing recognition tool + skill with + * deterministic image-task injection. Not in any default profile's bundles + * list; a user opts in per profile. + * @module @deepseek-ai/dsh-image-recognition-bundle + */ + +export {} diff --git a/packages/bundle/image-recognition/src/invariant.ts b/packages/bundle/image-recognition/src/invariant.ts new file mode 100644 index 0000000000..17dfc31cd6 --- /dev/null +++ b/packages/bundle/image-recognition/src/invariant.ts @@ -0,0 +1,30 @@ +/** + * Package-owned invariant companion for `@deepseek-ai/dsh-image-recognition-bundle`. + * @module @deepseek-ai/dsh-image-recognition-bundle/invariant + */ + +/* jscpd:ignore-start */ +import type { Context } from '@deepseek-ai/cordis' +import type { InvariantInstaller } from '@deepseek-ai/dsh-invariants' + +const PACKAGE_NAME = '@deepseek-ai/dsh-image-recognition-bundle' + +/** Cordis companion plugin name. */ +export const name = 'image-recognition-bundle-invariant' +/** Service required before the companion can reserve package ownership. */ +export const inject = ['invariants'] + +/** + * No runtime invariant: this bundle mounts a patch and owns no runtime state; + * the mounted capability's providers and consumer assert their own relations. + */ +const install: InvariantInstaller = () => {} + +/** + * Register this package's invariant companion. + * @param ctx - Cordis context carrying the invariant service. + * @returns the installed registration's disposer after setup succeeds. + */ +export const apply = (ctx: Context): Promise<() => void> => + Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install)) +/* jscpd:ignore-end */ diff --git a/packages/bundle/image-recognition/tsconfig.json b/packages/bundle/image-recognition/tsconfig.json new file mode 100644 index 0000000000..8f58ed6e28 --- /dev/null +++ b/packages/bundle/image-recognition/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "lib/types" + }, + "include": [ + "src" + ], + "references": [ + { + "path": "../../../vendor/cordis" + }, + { + "path": "../../runtime-diagnostics/invariants" + } + ] +}