invariant.ts 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Package-owned invariant companion for `@deepseek-ai/dsh-code-runtime-python`.
  3. * @module @deepseek-ai/dsh-code-runtime-python/invariant
  4. */
  5. /* jscpd:ignore-start */
  6. import type { Context } from '@deepseek-ai/cordis'
  7. import type { InvariantInstaller } from '@deepseek-ai/dsh-invariants'
  8. const PACKAGE_NAME = '@deepseek-ai/dsh-code-runtime-python'
  9. /** Cordis companion plugin name. */
  10. export const name = 'code-runtime-python-invariant'
  11. /** Service required before the companion can reserve package ownership. */
  12. export const inject = ['invariants']
  13. /**
  14. * No runtime invariant: this package ships only the fd-3 wire-protocol codec and its Python mirror,
  15. * exposing no runtime event sequence or mutable data relation; `protocol.spec.ts` and
  16. * `protocol-mirror.e2e.ts` cover the protocol's behavior.
  17. */
  18. const install: InvariantInstaller = () => {}
  19. /**
  20. * Register this package's invariant companion.
  21. * @param ctx - Cordis context carrying the invariant service.
  22. * @returns the installed registration's disposer after setup succeeds.
  23. */
  24. export const apply = (ctx: Context): Promise<() => void> =>
  25. Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install))
  26. /* jscpd:ignore-end */