Files
deepseek-harness/packages/vision/image-recognition/src/invariant.ts
T
Pine fc180997c6 feat(vision): add the image-recognition capability seam
Service Definition for ctx.imageRecognition: a provider registry and
provider-selecting execution, mirrored on the web seam (duplicate ids
rejected, order-independent selection, ImageRecognitionError taxonomy).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-14 10:55:57 +08:00

31 lines
1.1 KiB
TypeScript

/**
* Package-owned invariant companion for `@deepseek-ai/dsh-image-recognition`.
* @module @deepseek-ai/dsh-image-recognition/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'
/** Cordis companion plugin name. */
export const name = 'image-recognition-invariant'
/** Service required before the companion can reserve package ownership. */
export const inject = ['invariants']
/**
* No runtime invariant: the provider map is private and selection is enforced on
* each call; the seam publishes no independent registry or observation stream.
*/
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 */