invariant.ts 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Package-owned invariant companion for
  3. * `@deepseek-ai/dsh-subagent-claude-code`.
  4. * @module @deepseek-ai/dsh-subagent-claude-code/invariant
  5. */
  6. /* jscpd:ignore-start */
  7. import type { Context } from '@deepseek-ai/cordis'
  8. import type { InvariantInstaller } from '@deepseek-ai/dsh-invariants'
  9. const PACKAGE_NAME = '@deepseek-ai/dsh-subagent-claude-code'
  10. /** Cordis companion plugin name. */
  11. export const name = 'subagent-claude-code-invariant'
  12. /** Service required before the companion can reserve package ownership. */
  13. export const inject = ['invariants']
  14. /**
  15. * No runtime invariant: lifecycle pairing belongs to the shared subagent
  16. * service and process-tree ownership belongs to the subprocess service.
  17. */
  18. const install: InvariantInstaller = () => {}
  19. /**
  20. * Register this package's invariant companion.
  21. * @param ctx - plugin context carrying the invariant registry.
  22. * @returns the installed registration's disposer.
  23. */
  24. export const apply = (ctx: Context): Promise<() => void> =>
  25. Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install))
  26. /* jscpd:ignore-end */